No Table of Contents entries found

S

stuartjbray

Hi

I have a TOC in a template which only picks up certain types of
headings. This works fine when these headings are being used, but when
they aren't being used you get an ugly "Error! No Table of Contents
entries found" message. I don't want it to show this message.

As far as I know there is no TOC switch you can use to disable the
error message.

I know how to hide my TOC by formatting it as hidden. I can write the
VBA to toggle whether or not it shows. So my fallback plan was to have
a macro which searches the document for this type of text, and if it
can't find it, hide the TOC.

Am I missing something here?

Help appreciated gratefully.
 
S

Stefan Blom

An easy workaround is to add some dummy text in a heading style; that
way, you would never see the error message as documents are created
from the template.

In theory, a nested field should work, something like this:

{ IF { TOC } = "Error! No table of contents entries found" "" "{
TOC }" }

At least in my version of Word, this does not seem to work, though.
 
S

stuartjbray

Thanks for the suggestion. I couldn't get that to work in my Word 2003
either though.
 
S

Stefan Blom

Note that if you don't want to use "dummy headings" in the file,
select the TOC and create an AutoText entry from it. That way, you can
easily insert the correct field code when needed.
 

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