'Setting Metadata in Word and Retrieving in Excel
I'm trying to write a program that updates a Word document's metadata with content control boxes. The Excel document then loops through a directory that holds these documents and catalogs them by the metadata. In Word, I can set built-in properties in the DocumentBeforeSave sub via...
Application.ActiveDocument.BuiltInDocumentProperties("Keywords").Value = _
Application.ActiveDocument.SelectContentControlsByTitle("Tags").Item(1).Range.Text
and retrieve those in Excel via the shell...
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(WB.Path & "\QA\")
For Each strFileName In objFolder.Items
inputStr = objFolder.GetDetailsOf(strFileName, 18) 'Tags
'...
'...
next strFileName
The problem is that there are indexes in the "GetDetailsOf" function that I want to use but can't figure out how to set in Word. For example, I'd like to set the Division (GetDetailsOf index 155), Group (172), Program (277), and Attachments (219) fields. How do you set properties such as these that are not built-in?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|