Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2005

Tip: Looking for answers? Try searching our database.

CustomDocumentProperties

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Philippe Mermoud - 23 Aug 2005 15:58 GMT
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.
Edward Thrashcort - 23 Aug 2005 16:21 GMT
Can't you trap the error number of the failed .Add method?

Eddie
Philippe Mermoud - 24 Aug 2005 09:02 GMT
I'm not that expert in VBA. I know the trap mechanism but it exists in VBA ?
How can I use it ?

> Can't you trap the error number of the failed .Add method?
>
> Eddie
Jezebel - 24 Aug 2005 09:43 GMT
on error resume next
....

> I'm not that expert in VBA. I know the trap mechanism but it exists in VBA
> ?
[quoted text clipped - 3 lines]
>>
>> Eddie
Doug Robbins - 23 Aug 2005 18:04 GMT
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

Signature

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

> 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.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.