#1
|
|||
|
|||
Bookmark error in TOC when headings replaced
From a row in a Word table, I take 3 entries (A,B,C), concatenate them (A & B & C) and format them elsewhere in the document with the appropriate heading style, each concatenation on its own page. This is repeated for the 1300+ rows of the table. (The table is later deleted as it's no longer needed.) I then generate the table of contents, which shows each entry as A & B & C and the correct page number.
Great so far, but I then update the heading on each page with just A & B. When I print the doc, each TOC entry shows just A & B. The only way to get around this seems to be locking the TOC, but then if additional pages are added to the doc, the TOC page numbers are incorrect. If the TOC isn't locked, when the doc is printed, each TOC entry goes to just A & B. Whether Update Fields Before Printing is selected in Options doesn't seem to matter (as I remember...by now, though, I've tried so many things that my brain is mush and I may not have that correct). What's going on...and any suggestions to correct or a workaround? THANKS!!!! |
#2
|
|||
|
|||
What is it that you want to get around? Are you saying that you want the TOC to reflect A & B & C ..... 1
When the actual heading on page 1 that is used to define the TOC is just A & B? |
#3
|
|||
|
|||
Bookmark error in TOC when headings replaced
Precisely. Both the page heading and TOC start out as A & B & C, but after generating the TOC and before printing, the page heading gets shortened to just A & B.
|
#4
|
|||
|
|||
But you say in your original post that "YOU" update the page heading on each page:
"Great so far, but I then update the heading on each page with just A & B." If you TOC is created based on styles e.g., Heading 1 and you change the Heading 1 text then the TOC will update to reflect the changed text. You might try: Sub ScratchMacro() 'A basic Word macro coded by Greg Maxey ActiveDocument.TablesOfContents(1).UpdatePageNumbe rs lbl_Exit: Exit Sub End Sub |
#5
|
||||
|
||||
Quote:
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
toc, toc hyperlinks, toc problems |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bookmark not replaced when inserting but to lower right corner of image | newbieX | Word VBA | 6 | 11-20-2015 02:03 PM |
Bookmark Not Showing Bookmark | RegAudit | Word | 6 | 03-16-2015 11:08 PM |
Style Replaced When Deleting a Line | WordHostage | Word | 2 | 11-26-2011 11:24 AM |
Cannot remove replaced personal folder | rumin | Outlook | 2 | 01-31-2011 08:28 AM |
TOC printing Error Bookmark not Defined | techexpressinc | Word | 0 | 12-14-2008 05:24 PM |