Hi,
I'm hoping that someone can suggest a solution to the following problem:
I have a series of letter templates in Word (around 70 or so), that largely stay the same, but have certain fields that need to be regularly updated. My current process involves copy and pasting the folder containing all of the templates to a new location, and then going into the templates one by one and updating the relevant fields. I feel there must be a way to automate the process using VBA (although if anyone has a suggestion for a different means of automation, I'm all ears).
Many of the fields that need to be updated have multiple instances throughout one or more of the templates.
I set up an Excel spreadsheet with a list of all of the fields that ever need to be updated in the templates. As a test, I went through one of the templates and set the initial instance of each field to be updated as a Bookmark. I then replaced all subsequent instances of each field to be updated as Cross-references to the relevant Bookmark. I attempted to write a macro in the Excel workbook to open the relevant Word template, set each of the Bookmarks to the corresponding value from the Excel worksheet, and then "Update Field" for all Cross-references in the document, so that all updates to the Bookmarked fields would flow through to the other instances of those fields in the document. I was able to get as far as opening the appropriate Word template through VBA, but was not able to update the Bookmarks. Is this possible using VBA?
Thanks so much for your help!
I'm hoping that someone can suggest a solution to the following problem:
I have a series of letter templates in Word (around 70 or so), that largely stay the same, but have certain fields that need to be regularly updated. My current process involves copy and pasting the folder containing all of the templates to a new location, and then going into the templates one by one and updating the relevant fields. I feel there must be a way to automate the process using VBA (although if anyone has a suggestion for a different means of automation, I'm all ears).
Many of the fields that need to be updated have multiple instances throughout one or more of the templates.
I set up an Excel spreadsheet with a list of all of the fields that ever need to be updated in the templates. As a test, I went through one of the templates and set the initial instance of each field to be updated as a Bookmark. I then replaced all subsequent instances of each field to be updated as Cross-references to the relevant Bookmark. I attempted to write a macro in the Excel workbook to open the relevant Word template, set each of the Bookmarks to the corresponding value from the Excel worksheet, and then "Update Field" for all Cross-references in the document, so that all updates to the Bookmarked fields would flow through to the other instances of those fields in the document. I was able to get as far as opening the appropriate Word template through VBA, but was not able to update the Bookmarks. Is this possible using VBA?
Thanks so much for your help!