Как заменить значение переменных для текста MS Word?
Как заменить значение переменных для текста MS Word?
uses
Office97; {or Office2000, OfficeXP, Office_TLB}
var
VDoc, PropName, DocName: OleVariant;
VDoc := Word.ActiveDocument;
[an error occurred while processing this directive] { ... }
{ Set a document property }
PropName := 'MyOpinionOfThisDocument';
VDoc.CustomDocumentProperties.Add(PropName, False, msoPropertyTypeString,
'Utter drivel', EmptyParam);
{ Read a document property }
Caption := VDoc.CustomDocumentProperties[PropName].Value;
{ ... }
Взято с
Delphi Knowledge Base[an error occurred while processing this directive]