Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 03-30-2018, 12:30 PM
KjBox KjBox is offline Adding a Field to Word Document Windows 10 Adding a Field to Word Document Office 2016
Novice
Adding a Field to Word Document
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding the same field in the column field list of pivot table nanka Excel 4 03-19-2017 08:12 AM
Adding a link into a word document that when pressed, takes user to a page within the same document yan89 Word 1 04-29-2016 01:54 PM
Adding tables to Created word document whilst other word document open Help rpb925 Word VBA 18 03-30-2016 04:45 PM
Adding field in word in header in a bookmark in table with Excel vba Late Binding Hdr Excel Programming 6 02-11-2013 02:58 AM
Adding a Field to Word Document Excel vba adding field in word table/shape in a header Hdr Excel 1 02-04-2013 04:40 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:22 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft