Author: Deborah Pate
How to get and set the BuiltinDocumentProperty of a Word document
Answer:
1 { ... }2 var3 VDoc, PropName, DocName: OleVariant;
4 { ... }5 VDoc := Word.ActiveDocument;
6 {Get a built in property}7 ShowMessage(VDoc.BuiltInDocumentProperties['Title'].Value);
8 {Get a custom property}9 PropName := 'MyOpinionOfThisDocument';
10 VDoc.CustomDocumentProperties.Add(PropName, False, msoPropertyTypeString,
11 'Hey', EmptyParam);
12 Caption := VDoc.CustomDocumentProperties[PropName].Value;
13 { ... }