Thanks for your in depth response! See attached screenshot - these are pre-built Word documents, I want to put bookmarks next to "Effective Date", "Policy Number" and "Issued to" - which are always on line 7, 8 and 9 in all of these Word documents. I have some VBA code in Excel that looks for these bookmarks and inserts data from Excel into Word based on the bookmark names. (I've inserted the bookmarks manually into a Word document and the code has worked, I just thought I could save some time by creating these bookmarks in the 100+ Word documents programmatically rather than creating them in each individual Word file). Thank you!
Quote:
Originally Posted by Guessed
You need to define the locations based on how Word refers to its own structure
Word doesn't really work in terms of 'lines' since that is fluid based on a huge number of factors. 'Paragraphs' is the usual reference point.
Columns could be either talking about a page layout column or a table column. Either way, 20 is an extraordinarily large number for a real world situation. Page layout columns is another ill-defined term like 'lines' since it is also fluid. However table columns are easy to work with but you need to specify which table you are talking about.
If you want code that will work, you should post a sample document and identify what are the triggers that uniquely identify your chosen locations eg always the 3rd table, 3rd row, 20th column, 1st paragraph.
|