Hello,
I added some CustomDocumentProperties to my document which should be filled with a VBA form
When I open the form, fill out the fields and want to populate the entries to the custom fields in my document, only the ones which are in the text itself are added.
The fields which I added in header/footer or in textfields in the document are not filled.
This ist the code of the button click in the VBA Form:
Code:
Private Sub inpDocGenerate_Click()
' Update the properties values
ActiveDocument.CustomDocumentProperties("customDocType").Value = Me.inpDocType.Value
ActiveDocument.CustomDocumentProperties("customClientName").Value = Me.inpClientName.Value
ActiveDocument.CustomDocumentProperties("customDocTitle").Value = Me.inpDocTitle.Value
ActiveDocument.CustomDocumentProperties("customOfferNum").Value = Me.inpOfferNum.Value
ActiveDocument.CustomDocumentProperties("customDate").Value = Me.inpDate.Value
ActiveDocument.CustomDocumentProperties("customCity").Value = Me.inpCity.Value
ActiveDocument.CustomDocumentProperties("customAspName").Value = Me.inpAspName.Value
' Show changes of document properties in document
ActiveDocument.Fields.Update
' Hide the userform
UserForm1.Hide
End Sub