PC Review


Reply
Thread Tools Rate Thread

Does custom document property exist

 
 
XP
Guest
Posts: n/a
 
      3rd Mar 2008
Using Office 2003 on Win XP;

I need a function I can call that checks to see if a custom document
property exists; if not add it with a token string entry...

If anyone can post a generic example it would be most appreciated.

 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      3rd Mar 2008
Function CustomPropValue(prop As String)
Dim propValue As Variant

On Error Resume Next
propValue = ActiveWorkbook.CustomDocumentProperties(prop)
On Error GoTo 0
If IsEmpty(propValue) Then

propValue = "Initial"
ActiveWorkbook.CustomDocumentProperties.Add _
Name:=prop, _
LinkToContent:=False, _
Type:=msoPropertyTypeString, _
Value:=propValue
End If

CustomPropValue = propValue
End Function


--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"XP" <(E-Mail Removed)> wrote in message
news:1908EAF4-913C-4EB9-89D9-(E-Mail Removed)...
> Using Office 2003 on Win XP;
>
> I need a function I can call that checks to see if a custom document
> property exists; if not add it with a token string entry...
>
> If anyone can post a generic example it would be most appreciated.
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
QuickParts can't reference the custom document property Michael Nemtsev Microsoft Word Document Management 3 30th Oct 2009 12:06 PM
outlook property does not exist custom form SLP Microsoft Outlook Discussion 0 18th Aug 2008 09:10 PM
Display Custom Document Property Gary''s Student Microsoft Excel Programming 1 27th May 2008 06:11 PM
Custom Document Property in Access =?Utf-8?B?VG9uaQ==?= Microsoft Access VBA Modules 1 12th May 2007 08:00 AM
Get ADP Custom Database Property - Document Number Value ** $100 To Any Can Do It... cj_008@comcast.net Microsoft Access ADP SQL Server 7 9th Feb 2006 04:31 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:56 PM.