Windows Phone Developers

Friday, December 5, 2008

How to get the Built-in Properties of a Word Document using VSTO

BuiltinDocumentProperties returns the entire collection of Built-in document properties. Use the Microsoft.Office.Core.DocumentProperties.Item(System.Object) property to return a single member of the collection (a Microsoft.Office.Core.DocumentProperties object) by specifying either the name of the property or the collection index (as a number).

private static void WordBuiltinPropExample(Word.Document oWD)

{

// Built-in Document Properties for a Word Document

Office.DocumentProperties oBuiltProps = (Office.DocumentProperties)oWD.BuiltInDocumentProperties;

foreach (Office.DocumentProperty oBuiltProp in oBuiltProps)

{

MessageBox.Show(oBuiltProp.Name + " " + oBuiltProp.Value);

}

}

Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

No comments:

Post a Comment