Wednesday 6 April 2011

Write information into subject line of word document properties using VBA

The document properties within Word can be manipulated using VBA code and here are a few ways that we can write information to them. VBA_logo
To write hard coded text
ActiveDocument.BuiltInDocumentProperties("Subject") = “Hello World”
To write the value of a variable into the subject line
ActiveDocument.BuiltInDocumentProperties("Subject") = VariableName
To clear the subject line of any information
ActiveDocument.BuiltInDocumentProperties("Subject") = “”



No comments:

Post a Comment