View Single Post
 
Old 05-11-2016, 08:33 AM
vince692 vince692 is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: May 2016
Posts: 22
vince692 is on a distinguished road
Default Get CustomDocumentProperties

I want to read CustomDocumentProperties, here is my code but i can't get the
"ActiveDocument.CustomDocumentProperties.Count " working :
I tried with "ThisDocument.CustomDocumentProperties.Count" as well.

In Excel, "ThisWorkbook.CustomDocumentProperties.Count" works.

Code:
'Read CustomDocumentProperties in a WordDocument
Dim cp As DocumentProperty

'Check if CustumDocumentProperties exist ...
If ActiveDocument.CustomDocumentProperties.Count = 0 Then
MsgBox "Generation path not found"
Exit Sub

For Each cp In ActiveDocument.CustomDocumentProperties
    MsgBox cp.Name & vbLf & cp.Value
Next cp
End If
Any ideas ?
Reply With Quote