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.

Re: CustomDocumentProperties by Doug

Doug
Tue Aug 23 12:04:24 CDT 2005

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
"Philippe Mermoud" <aqw@aqw.net> wrote in message
news:430b39a5$0$3950$636a15ce@news.free.fr...
> 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.
>
>



Re: CustomDocumentProperties by Philippe

Philippe
Wed Aug 24 03:02:42 CDT 2005

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

"Edward Thrashcort" <IdontWantSpam@nospam.net> a écrit dans le message de
news: memo.20050823162131.62597C@eonsol.compulink.co.uk...
> Can't you trap the error number of the failed .Add method?
>
> Eddie



Re: CustomDocumentProperties by Jezebel

Jezebel
Wed Aug 24 03:43:01 CDT 2005

on error resume next
....



"Philippe Mermoud" <aqw@aqw.net> wrote in message
news:430c29a3$0$2967$626a14ce@news.free.fr...
> I'm not that expert in VBA. I know the trap mechanism but it exists in VBA
> ?
> How can I use it ?
>
> "Edward Thrashcort" <IdontWantSpam@nospam.net> a écrit dans le message de
> news: memo.20050823162131.62597C@eonsol.compulink.co.uk...
>> Can't you trap the error number of the failed .Add method?
>>
>> Eddie
>
>