My document has a form with bookmarked content controls that link to Custom Document Properties via the Link-to-Content option. The Custom Document Properties are used to display form values in reports later in the document. The only problem with that approach is that when a value is updated in the form, it doesn't automatically update the value of the linked custom document property.
When updating the form manually, I found just accessing the Advanced Properties dialog updates the links. (Then I select report content and press F9 to update the DOCPROPERTY fields.) But now I need to automate filling in the form, and I can't find a way to update the links in VBA. I've tried accessing the custom document properties, and even replacing the link source with the original source thinking that accessing the links might update them (see code below), but the linked values aren't changed this way. Does anyone know how to programmatically update those links? How does the Advanced Properties dialog do it?
With wdDoc
For Each dp In .CustomDocumentProperties
If dp.LinkToContent Then
dp.LinkSource = dp.LinkSource
End If
Next dp
.Content.Fields.Update
End With