Error! Bookmark not defined when Printing

D

dweilbacher

I know this question has been asked before, but from the threads I've seen,
no solution was found. I have additional information and would like to
re-ask the question.

I have several Word 2003 document that use Field Codes. The field codes are
simple IF statements to include/not include various Heading 5, Block Lables.
The field code is triggered on a Bookmark at the top of the document.
Example: If DOC = "IEH" "Block 1" "Block 2".

In addition, I have the same field code around the TOC. I want a different
format for my TOC so I use the same field code: If DOC = "IEH" "TOC 1"
"TOC2".

The field codes work great, execpt one issue. If I open the document and
look at the TOC, it will be fine. However, when I print it, the TOC will
update and any line pointing to a Field Code Block, will list as: Error!
Bookmark not Defined (both on-line version and the printed version will have
the errors).

I then need to update the TOC and then print again to correct the Bookmark
errors. This appears to be a bug in Word as it does not properly handle TOC
which point to a Field Coded block label.

I'm curious if anyone else has seen this -or- has a suggestion on how to fix
it. Also, how do I get this information to Microsoft for a future fix?

Thanks!
 
S

Suzanne S. Barnhill

What is behind your "TOC 1" and "TOC 2" in the field. Are these AutoText
fields, IncludeText, or what?
 
D

dweilbacher

Not sure I understand your question, but here is what I know about the TOCs.

TOC1 and TOC2 are idenitical, except for the TOC Level
(Insert->References->Index and Tables, then TOC Tab and Options button. TOC1
uses Heading 4
and 5. TOC2 uses Heading 4 only. Hence just a format difference.

If I toggle two of the TOC lines, it looks like this:
{ HYPERLINK \L "_TOC134515345" }
{ HYPERLINK \L "_TOC134515353" }

Un - Toggled it looks like this:
GENERAL
...............................................................................3
Section Description
..............................................................4

I generate the TOC using Insert->References->Index and Tables.

Hopefully somewhere in there answers your question. And thanks for the help.
 
S

Suzanne S. Barnhill

Hmm. I'm not sure what the hyperlinks are going to, but this seems to me a
rather iffy way of handling this setup. I would suggest pasting in the
actual TOC fields, as generated using Insert | Reference | Index and Tables.
These will look something like this:

{ TOC \h \z \u \t "Heading 4,1,Heading 5,2" }
{ TOC \h \z \u \t "Heading 4,1" }

These assume that you're using the TOC 1 and TOC 2 styles for levels 4 and 5
in the TOC.

They will always show "Error! Bookmark not defined" in your document until
some Headings 4 and Heading 5 paragraphs have been created and the TOC
updated.
 
D

dweilbacher

Suzanne,
First let me thanks you for your help and sorry for taking so long to reply.

I've changed the TOC as you indicated below (from Hyperlinks to TOCs). Note
that I used Hyperlinks in order to allow the reader to click on a TOC entry
and be directed to that section of the document. Obviously not useful for
paper copy, but helpful for those using the online version. Setting the link
is easy (Insert | Reference | Index and Tables (click checkbox "Use
hyperlinks instead of page numbers").

Anyways, changing the TOC as you requested did not correct the issue.

I believe I understand what is causing the issue, but no idea how to correct
it. I'll try to explain, but this will get lenghty. My document should be
thought of as 2 versions of the doc in one file. The Field Codes allows me
to toggle between each version. The difference in the versions are simply:
- TOC level
- Several Level 5 Blocks are simply not in one version of the doc.

Note that I view (toggle) the versions using the following:
- change bookmark from PCM to IEH
- Ctrl - A (select all)
- F9 (update all)

I first start by viewing(toggling) the version without the Level 5 blocks.
Then toggle back to version with the Level 5 blocks. When I do this, I
believe Word updates the TOC first and then update the rest of the doc. This
could be the cause of the issue as the Level 5 blocks are not current there
when the TOC is updated. Oddly, the TOC looks ok at this point. However, if
I print now, the TOC lines that point to the Level 5 Blocks will all change
to Error, not defined. I have to then manually update the TOC again in order
to clear the Error and print correctly.

To me this indicates that when Word is updating (F9) the doc, it does it Top
down. The TOC is done first and then other Field codes in the doc are done.
I believe the TOC should be done last to ensure that all blocks are in the
doc before updating the TOC. Not really a bug, but maybe a short coming of
Word.

I'm still open to any suggestions.
Again, Thanks for you help.
 
D

dweilbacher

Also, just want to make this clear...

The problem is ONLY seen if your bookmark changes both:

- The TOC (change the levels seen), and
- Blocks are removed/added with each toggle

I did another test, in which I toggled as stated above which update the TOC
first and then the rest of the doc. I then manually update the TOC again
before printing. This time, printing did not cause the TOC Errors.
Verifying, in my mind, that the TOC needs to be updated last after the rest
of the doc is updated.

Again a short coming in Word, in my opinion.
 
S

Suzanne S. Barnhill

I really don't understand what you're doing, but I gather that you are
changing the content of the document, which will affect the content of the
TOC. Naturally the TOC must be updated after you change the content. Also,
I'm still not sure you have fully realized that all TOC entries are
hyperlinked to the headings by default. Even when the whole entry is not
hyperlinked, the page number is.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top