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);
}
}
No comments:
Post a Comment