Author: Tomas Rutkauskas
I want to read the properties of a MS Word document (the title). I use the function
builtInDocumentProperties, but it returns a IDispatch Interface and I don't know
how to get the value. If I write Document.BuiltInProperties[wdPropertyTitle].Value,
I get an error.
Answer:
Variants are the easiest way of dealing with these properties.
1 { ... }2 var3 Doc: OleVariant;
4 { ... }5 Doc := Word.ActiveDocument;
6 Doc.BuiltInDocumentProperties['Title'].Value := 'The title';
7 Doc.BuiltInDocumentProperties['Category'].Value := 'Category';
8 { ... }