OK. I have searched long and hard and wanted to know if there is an
easy/elegant/direct way to enumerate through all the DocumentProperties
and the CustomDocumentProperties for a Word document using C#.
For example say clearing all the DocumentProperties and the
CustomDocumentProperties. (using VS 2005/ VSTO)
Thanks
Holden
Hi Holden,
> OK. I have searched long and hard and wanted to know if there is an
> easy/elegant/direct way to enumerate through all the DocumentProperties
> and the CustomDocumentProperties for a Word document using C#.
>
> For example say clearing all the DocumentProperties and the
> CustomDocumentProperties. (using VS 2005/ VSTO)
Easy and elegant? No... The problem is that C# requires strong typing,
and the Office application object models don't provide the document
properties except through late-binding. So C# can only pick them up
through GetType.InvokeMember. See
http://support.microsoft.com/kb/303296/en-us
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)