Use
ActiveDocument.CustomDocumentProperties("MyFormattedDate").Value
to both read and write the value.
You could add some testing code to make sure the variables are in the
document if there's a possibility that they might not be, eg
Dim docProp As DocumentProperty
Dim blnFound As Boolean
blnFound = False
For Each docProp In ActiveDocument.CustomDocumentProperties
If docProp.Name = "MyFormattedDate" Then
blnFound = True
End If
Next docProp
With ActiveDocument
If blnFound = False Then
.CustomDocumentProperties.Add _
Name:="MyFormattedDate", _
Value:="MyValue"
Else
.CustomDocumentProperties("MyFormattedDate").Value = "x/x/xx"
End If
End With
> I wish to do the following, and I am having a hard time figuring out
> how from the documentation:
[quoted text clipped - 5 lines]
>
> Thanks to all