Leila said:
For this checking I get below error, please help, thanks
If (ActiveDocument.CustomDocumentProperties("MyProperty")
= False) Then
*err* Invalid procedure call or argument
Hi Leila
You need to use the property's .Value member:
If (ActiveDocument.CustomDocumentProperties("MyProperty").Value = False)
Then
The other thing is that if you try to retrieve the value of a doc property
that doesn't exist, you'll get the same error. The way to avoid that is to
loop through all the doc properties like this:
Dim prop As DocumentProperty
For Each prop In ActiveDocument.CustomDocumentProperties
If prop.Name = "MyProperty" Then
If prop.Value = False Then
MsgBox "It's False"
End If
End If
Next prop
The example in the CustomDocumentProperties topic in the help shows another
loop like this.