View Single Post
 
Old 03-30-2018, 12:30 PM
KjBox KjBox is offline Windows 10 Office 2016
Novice
 
Join Date: Mar 2018
Posts: 6
KjBox is on a distinguished road
Default

Even if adding bookmarks to the blank document did work I could not use it because there can be multiple Fields under most of the headings.

I am attaching the Excel file and a blank Word document (with the preset Styles) and a manually created document which shows the desired result after the blank document is populated.

CTRL+SHIFT+A from the Excel file is the shortcut to start the process.

Running the PopulateWord procedure with "On Error Resume Next" at the start results in all the headings being correct and the paragraphs between them for the Field(s) is correct, just no Fields!

Without "On Error Resume Next" the code errors on every ".Fields.Add......"
Attached Files
File Type: xlsm Mergefields_Master.xlsm (46.9 KB, 10 views)
File Type: docx MERGEFIELDS_Report_Blank_Style_1.docx (11.8 KB, 11 views)
File Type: docx MERGEFIELDS_Report_Example.docx (12.9 KB, 10 views)
Reply With Quote