View Single Post
 
Old 08-18-2020, 06:21 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,177
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I'm not seeing how you plan to make use of the document variables in the document itself. I assume your other code is looping through the variables that exist and then places fields into the document at relevant positions. You are going to have broken fields unless you also have macros to clean up content when variables don't exist.

If you need further help on this, post a sample document showing how your userform is coded and a couple of examples of where variables are used in the body of the document.

FWIW, I have never used Document Variables as I didn't like having stuff I couldn't also see and edit with the GUI. When I had similar requirements I used Document Built-in and Custom properties. Nowdays I make use of XML and linked Content Controls for these types of tasks. Linked CCs allow contents of these variables to be populated directly from the document, don't require field updates to refresh and are more forgiving when backend fields are missing.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote