Get office document properties

A

Alex

Is there a way to get the properties (specifically the path\file name) of the
current open document from .net? I have a ,net application which using
windows message hooks, detect when an office application is opened or got
focus. I need to get the document name and path without actually opening it
since I don't have any information about it except the window handle.
 
C

Chirag

You can perhaps do the following:
1. Get the ProcessId corresponding to the window handle using
GetWindowThreadProcessId().
2. Enumerate all open file handles for this process id.
3. Most of them will be DLLs/add-ins but some of them will be
..doc,.ppt,.xls.

- Chirag

PowerShow - View multiple PowerPoint slide shows simultaneously
http://officeone.mvps.org/powershow/powershow.html
 

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