CustomDocumentProperties

P

Philippe Mermoud

After having added a custom document property (using "Add") how can I know
whether it is or not in my document ? If I call Add again it crashes down
saying the property exists already.
 
D

Doug Robbins

Dim Flag As Boolean, prop As CustomProperty
Flag = False
For Each prop In ActiveDocument.CustomDocumentProperties
If prop.Name = "mycustomproperty" Then
Flag = True
End If
Next
If Flag = True Then
MsgBox "The Custom Property exists."
Else
MsgBox "The Custom Property does not exist."
End If


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
P

Philippe Mermoud

I'm not that expert in VBA. I know the trap mechanism but it exists in VBA ?
How can I use it ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top