G
Greg Maxey
Does anyone know how to access the "MetaProperty" object and
"MetaProperties" collection in a Word document. I can run Test1 to get
BuiltInDocumentProperties and Test2 to get CustomDocumentProperties, but
Test3 fails.
Sub Test1()
Dim prop As DocumentProperty
For Each prop In ActiveDocument.BuiltInDocumentProperties
On Error Resume Next
Debug.Print prop.Name & " - " & prop.Value
Next
End Sub
Sub Test2()
Dim prop As DocumentProperty
For Each prop In ActiveDocument.CustomDocumentProperties
On Error Resume Next
Debug.Print prop.Name & " "; prop.Value
Next
End Sub
Sub Test3()
Dim prop As MetaProperty
For Each prop In ActiveDocument.MetaProperties '???????????
On Error Resume Next
Debug.Print prop.Name & " "; prop.Value
Next
End Sub
There is a dearth of information on this object and collection in the VBA
help file. Someone sent me a Word document that had a bunch of metadata
fields (shown using Office Menu>Prepare>Properties "Application Properties -
Server") that where created using SharePoint (know idea what that is). Each
one of these fields has a corresponding entry on Insert>QuickParts>Document
Properties. When I click one a content control is inserted in the document
apparently mapped to this data. The problem is that the data in his
sharepoint server is in currency format and the format of the CC is stripped
of the "$" and "commas." I am trying to figure out how to get access to
these properties programatically to format them.
Thanks.
"MetaProperties" collection in a Word document. I can run Test1 to get
BuiltInDocumentProperties and Test2 to get CustomDocumentProperties, but
Test3 fails.
Sub Test1()
Dim prop As DocumentProperty
For Each prop In ActiveDocument.BuiltInDocumentProperties
On Error Resume Next
Debug.Print prop.Name & " - " & prop.Value
Next
End Sub
Sub Test2()
Dim prop As DocumentProperty
For Each prop In ActiveDocument.CustomDocumentProperties
On Error Resume Next
Debug.Print prop.Name & " "; prop.Value
Next
End Sub
Sub Test3()
Dim prop As MetaProperty
For Each prop In ActiveDocument.MetaProperties '???????????
On Error Resume Next
Debug.Print prop.Name & " "; prop.Value
Next
End Sub
There is a dearth of information on this object and collection in the VBA
help file. Someone sent me a Word document that had a bunch of metadata
fields (shown using Office Menu>Prepare>Properties "Application Properties -
Server") that where created using SharePoint (know idea what that is). Each
one of these fields has a corresponding entry on Insert>QuickParts>Document
Properties. When I click one a content control is inserted in the document
apparently mapped to this data. The problem is that the data in his
sharepoint server is in currency format and the format of the CC is stripped
of the "$" and "commas." I am trying to figure out how to get access to
these properties programatically to format them.
Thanks.