K
KR
I need to be able to change the value of a custom document property if it
exists, and if it doesn't exist, create the CDP and set the value at the
same time.
The following creates a CDP, but crashes when I try to update the CDP. What
is the easiest (fewest lines of code) method to determine whether the CDP
exists, create it if it doesn't, then set the value (and if it does exist,
just set the value)?
Thanks,
Keith
ActiveDocument.CustomDocumentProperties.Add _
Name:="YourName", LinkToContent:=False, Value:="TestValue2", _
Type:=msoPropertyTypeString
exists, and if it doesn't exist, create the CDP and set the value at the
same time.
The following creates a CDP, but crashes when I try to update the CDP. What
is the easiest (fewest lines of code) method to determine whether the CDP
exists, create it if it doesn't, then set the value (and if it does exist,
just set the value)?
Thanks,
Keith
ActiveDocument.CustomDocumentProperties.Add _
Name:="YourName", LinkToContent:=False, Value:="TestValue2", _
Type:=msoPropertyTypeString