1

Is there a way to find the currently open file from an Excel or Word process? For example, i want to get all the list of running processes in windows and which files they currently have open.

Thanks in advance!

skaffman
  • 398,947
  • 96
  • 818
  • 769
Pete
  • 11
  • 1
  • 1
    Possible duplicate of [How do I get the list of open file handles by process in C#?](http://stackoverflow.com/questions/177146/how-do-i-get-the-list-of-open-file-handles-by-process-in-c). See the [sample on CodeProject](http://www.codeproject.com/KB/shell/OpenedFileFinder.aspx?fid=422864&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=26&select=2277170) mentioned in one of the answers. – Dirk Vollmar Aug 23 '10 at 16:34
  • I'm confused, are you asking for the currently open word/excel document (presumably from within a C# plugin) or are you asking for a list of all processes? Please clarify. – Doctor Jones Aug 23 '10 at 16:43

1 Answers1

2

I am not sure of how to programmaticly do this, but if you are asking in general or looking for a tool to do it Process Explorer can under "View Handles" and look for the type "File". You can also see which program has a specific file open by clicking the binoculars.

Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
  • 1
    In other words--it's a log of ugly low-level programming if you had to code it yourself. – Russ Aug 23 '10 at 16:30