I have a program which outputs a collection of tables in a word document which I eventually want to post as an html file with bookmarks and an index. The tables are grouped by "Name:" where there is a 3 row table that contains detailed header information for a section of data, then there is a second table which can span multiple pages which contains the data for that section. There is then a page break so that the next sections header table is on a new page. This can occur for a variable number of sections numbers in the hundreds. I need to write a script that
- searches my document for "Name:", which is unique and would not appear anywhere but the header table,
- grabs the text that follows "Name:" within that table cell (for example "Name: Line 1234)
- replaces all the blanks in that text string with an underscore to make it a suitable bookmark name,
- creates a bookmark with the name,
- goes back and creates an index at the front of the document
- Saves the file as an html
I have a passing familiarity with VB for word, I have used it a bit in excel, but am by no means an expert. I would appreciate any advice on functions and objects that I should be using for this script.