troubleshooting Question

How do I read custom document properties in Word 2007 using C#?

Avatar of iaexpexchange
iaexpexchangeFlag for Netherlands asked on
C#Microsoft Word
5 Comments1 Solution4877 ViewsLast Modified:
I'm working on a Word 2007 add-in using VSTO and C#. I want to read and write custom document properties. I managed to write custom properties eventually, I can't find a way to read them however. Below the code I use to write the custom document properties.


oDocCustomProps = Globals.ThisAddIn.Application.ActiveDocument.CustomDocumentProperties;
            Type typeDocCustomProps = oDocCustomProps.GetType();
 
            object[] oArgs1 = {"Guid",false,
                     MsoDocProperties.msoPropertyTypeString,
                      "VALUE"}
 
            typeDocCustomProps.InvokeMember("Add", BindingFlags.Default |
                                       BindingFlags.InvokeMethod, null,
                                       oDocCustomProps, oArgs1);
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros