Script to set Keyword in MS Word

The title says it all: anyone got any insight into how to set a keyword and/or category and/or comments in the “Properties/Summary Tab” of an MS Word document?

Hi there,

Having looked through the dictionary I can’t see anything to set this info. I’m sure someone will correct me if i wrong :wink:

I did a little trawling on the web and came up with some VBA that allows you to set this info.
So, I created the Macro below in MS Word and gave it the name SetSummaryInfo2.

Sub SetSummaryInfo2()

ActiveDocument.BuiltInDocumentProperties(wdPropertyTitle) = “xxx Title xxx”
ActiveDocument.BuiltInDocumentProperties(wdPropertySubject) = “xxx Subject xxx”
ActiveDocument.BuiltInDocumentProperties(wdPropertyAuthor) = “xxx Author xxx”
ActiveDocument.BuiltInDocumentProperties(wdPropertyManager) = “xxx Manager xxx”
ActiveDocument.BuiltInDocumentProperties(wdPropertyCompany) = “xxx Company xxx”
ActiveDocument.BuiltInDocumentProperties(wdPropertyCategory) = “xxx Category xxx”
ActiveDocument.BuiltInDocumentProperties(wdPropertyKeywords) = “xxx Keywords xxx”
ActiveDocument.BuiltInDocumentProperties(wdPropertyComments) = “xxx Comments xxx”
ActiveDocument.BuiltInDocumentProperties(wdPropertyHyperlinkBase) = “xxx Hyperlink Base xxx”

End Sub

I then called the Macro using the AS code below:

tell application "Microsoft Word"
	run VB macro macro name "SetSummaryInfo2"
end tell

That worked for me.