Voicepath
asked on
How do I get / Set the Properties of an Active Word Document ?
My Appliacation displays an instance of Word in a custom control on a WinForm. The surrounding WinForm displays extra details about the actie document being tracked by my application. One of the extra bits of information is the Document Properties of the Active Document (currently retrieved using DSOleFile.dll). BUT, my app needs to be able to update the Document Properties while the Document is still open. I can't do this with DSOleFile.dll because of a file open lock on the Document.
I have found some examples of getting / setting the Document Properties using VB / VBA and VSTO but not C#.
I can get to the object "objWinWordControl.WordApp Class.Acti veDocument .BuiltInDo cumentProp erties" but I can't find a way to access the subject, comment or template properties that I need.
Does anyone have any example code of how to get / set Document Properties of an ActiveDocument open in Word ?
I have found some examples of getting / setting the Document Properties using VB / VBA and VSTO but not C#.
I can get to the object "objWinWordControl.WordApp
Does anyone have any example code of how to get / set Document Properties of an ActiveDocument open in Word ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the input irudyk,
Using your first suggestion; BuiltinProperties("Subject ") gives me an error "is a Property but is used like a method".
The link you sent worked nicely once I'd changed all the object names and I found BindingFlags in System.Reflection. But what a palava just to get the property of an avtive document !!
A Thousand Thanks to you irudyk.
Using your first suggestion; BuiltinProperties("Subject
The link you sent worked nicely once I'd changed all the object names and I found BindingFlags in System.Reflection. But what a palava just to get the property of an avtive document !!
A Thousand Thanks to you irudyk.
ASKER
Thanks again Irudyk.
Have a good day.
Have a good day.
Read/Write items:
objWinWordControl.WordAppC
objWinWordControl.WordAppC
Read only item:
objWinWordControl.WordAppC