J
JHARRIS133
I am trying to create a version feature in Word VBA. I've got most of it to
work properly, but for some reason, I am unable to set this value. I have
created both a bookmark and a Word.Variable named "Version" to handle this
processing. I have correctly linked the source of the bookmark, Version, to
the variable. The bookmark source correctly updates, but the bookmark value
does not update correctly, and shows a broken link when I view it in the
File-->Properties window.
So everything is working properly, except for the updating of the Value of
the Version property. Below is the code that is crashing, specifically, the
line that reads, CustomDocumentProperties("Version").Value = lnkSrc. This
keeps saying that the Value method of DocumentProperty has failed. Value is
not a method, but a property in this instance, how can I fix this?
The following code is run when the user clicks on a button to update the
version number:
For Each prop In ThisDocument.CustomDocumentProperties
If prop.Name = "Version" Then
Dim lnkSrc
lnkSrc = ThisDocument.Variables(1).Value
CustomDocumentProperties("Version").LinkSource = lnkSrc
CustomDocumentProperties("Version").Value = lnkSrc
End If
Next
work properly, but for some reason, I am unable to set this value. I have
created both a bookmark and a Word.Variable named "Version" to handle this
processing. I have correctly linked the source of the bookmark, Version, to
the variable. The bookmark source correctly updates, but the bookmark value
does not update correctly, and shows a broken link when I view it in the
File-->Properties window.
So everything is working properly, except for the updating of the Value of
the Version property. Below is the code that is crashing, specifically, the
line that reads, CustomDocumentProperties("Version").Value = lnkSrc. This
keeps saying that the Value method of DocumentProperty has failed. Value is
not a method, but a property in this instance, how can I fix this?
The following code is run when the user clicks on a button to update the
version number:
For Each prop In ThisDocument.CustomDocumentProperties
If prop.Name = "Version" Then
Dim lnkSrc
lnkSrc = ThisDocument.Variables(1).Value
CustomDocumentProperties("Version").LinkSource = lnkSrc
CustomDocumentProperties("Version").Value = lnkSrc
End If
Next