Could anyone tell me how to programmatically list the filenames of all open office files (winword.doc files, excel.xls files) ?

Recommended Answers

All 8 Replies

Use FileInfo and DirectoryInfo classes would help you.

Use FileInfo and DirectoryInfo classes would help you.

Thank you for the reply.
I have been using Process-GetProcesses and ManagementClass so far and I can get the information I want from some types (like iexplore).
I cannot see how FileInfo or DirectoryInfo could help as I want to get only the application names and the filenames of those files currently open in their relevant applications.

You need to list all files with these extensions (.doc, .xsl, etc...) in a directory? or you need to get opened files in some applications?

You need to list all files with these extensions (.doc, .xsl, etc...) in a directory? or you need to get opened files in some applications?

I want to create a list of those files and applications, that are currently open. Thanks again.

To get processes you need to work with System.Diagnostics.Process class.
To get currently opened files with MS Word, ect... you need to automate with them, did you try to play with Word from your C# application?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.