Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default Does custom document property exist

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.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Does custom document property exist

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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Does a HasDependents = True property exist? Dave O Excel Discussion (Misc queries) 4 April 13th 10 09:32 PM
Use Custom Document Property to identify xls files not yet process Robert_L_Ross Excel Programming 2 September 28th 07 01:49 AM
Putting the document number custom property in workbook DRK Excel Programming 1 June 13th 06 12:10 PM
Can you link a custom property to an Excel custom header text? LouErc Setting up and Configuration of Excel 0 November 8th 05 04:58 PM
convert existing Excel into Data source document to link to exist. KayLMPD Excel Discussion (Misc queries) 1 March 29th 05 12:37 PM


All times are GMT +1. The time now is 05:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"