2005. december 29., csütörtök

Get and set the BuiltinDocumentProperty of a Word document

Problem/Question/Abstract:

How to get and set the BuiltinDocumentProperty of a Word document

Answer:

{ ... }
var
VDoc, PropName, DocName: OleVariant;
{ ... }
VDoc := Word.ActiveDocument;
{Get a built in property}
ShowMessage(VDoc.BuiltInDocumentProperties['Title'].Value);
{Get a custom property}
PropName := 'MyOpinionOfThisDocument';
VDoc.CustomDocumentProperties.Add(PropName, False, msoPropertyTypeString,
'Hey', EmptyParam);
Caption := VDoc.CustomDocumentProperties[PropName].Value;
{ ... }


Nincsenek megjegyzések:

Megjegyzés küldése