File Name(Word)

J

John

It's been 30min and haven't seen my post yet (sorry to
post twice).
Q: How do I get the file name(which is opened) of a
text/doc file if I have the process information of the
application(notepad/word) that opened/ceated the file.
Thanks alot.
 
N

Nicholas Paldino [.NET/C# MVP]

John,

You can't do it without doing some very specific coding against the
application that you know is running. If you know that word is running, you
can use the automation objects to access that instance of word and find out
which document is running in that process.

Notepad is a different story however. There is nothing in notepad that
is publically accessible that offers up what file is being worked on. If
you have a file open in notepad, the title of the file is in the toolbar,
but that is it. It does not give you the directory that the file came from.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top