Word '03 doesn't find TOC entries

P

Paul B

Hi,

Suddenly, on one large (2M) file, Word does not insert a table of
contents, saying that no TOC entries were found. There are many
entries, and up til this morning the doc had a functioning TOC.
But when I refreshed the TOC I lost it.

What's more, I'm generally getting a "Word has insufficient
memory" error when I try to insert a TOC.

So far, this is the only doc that does this. I've tried removing
the material I added today, but that didn't help.

p.
 
T

Terry Farrell

Try using Word, File, Open, select the document and choose Open and Repair.
Does that resolve the problem?
 
T

Terry Farrell

How are you creating your TOC. Are you using the Heading Styles or are you
inserting the fields manually?

Terry
 
P

Paul B

How are you creating your TOC. Are you using the Heading Styles or are you
inserting the fields manually?


I use heading styles. Hyperlinks instead of page numbers. Showing
headers down to level 5, I believe.

Thanks,
p.
 
T

Terry Farrell

It does sound as though the document has become corrupt. Try selecting all
but the final paragraph mark and copying it all into a new blank document.

Open the document, Ctrl+End, Ctrl+Shft+Home, Ctrl+C open a new blank
document and Ctrl+V. Save the new version and try creating a new TOC.

If it fails now, I'd check that all the Headings are still formatted
correctly as Headings still.

Terry
 
P

Paul B

It does sound as though the document has become corrupt. Try selecting all
but the final paragraph mark and copying it all into a new blank document.

Open the document, Ctrl+End, Ctrl+Shft+Home, Ctrl+C open a new blank
document and Ctrl+V. Save the new version and try creating a new TOC.

If it fails now, I'd check that all the Headings are still formatted
correctly as Headings still.

Strange. I pasted everything up to a recent date before the
problem manifested. No problem calling up a TOC. Then I pasted
the rest; no TOC.

Then I did it again, but this time I "scrubbed" the latter data
by first saving it to a text editor, then pasting it in plain
text, then marking it up manually. The error reappeared.

For now, baffled.

Thanks,
p.
 
P

Paul B

Strange. I pasted everything up to a recent date before the
problem manifested. No problem calling up a TOC. Then I pasted
the rest; no TOC.

Then I did it again, but this time I "scrubbed" the latter data
by first saving it to a text editor, then pasting it in plain
text, then marking it up manually. The error reappeared.

For now, baffled.

Thanks,
p.

I forgot to mention that if I then remove the latter text that
seemingly causes the problem, the TOC still won't manifest. There
must be something generated that I'm not getting to that makes
the problem permanent.

p.
 
T

Terry Farrell

Paul

How big is the document? Are you able to zip it and post it to me as an
attachment to an email?

Terry
 
T

Terry Farrell

Paul

I've just got notification of new mail! I'll download it shortly and will
probably not look at the problem until the morning now.

Terry
 
T

Terry Farrell

Well I had a quick look. There's a hidden corruption in or around page
180/181. If you copy all but the final paragraph mark and paste into a new
document, it removes the corruption. Use Ctrl+End, Ctrl+Shift+Home, Ctrl+C,
open a new blank document and then Ctrl+V. The TOC then works fine as does
the pagination after page 180.

Open and Repair doesn't find this corruption though.

Terry
 
P

Paul B

Did you try to Refresh the TOC? I sometimes can get an initial
TOC after I've removed text, but Word reverts to the error when I
try to refresh it.

After I read your post, I went back and began to peel off
sections from the bottom, pasting them to a new file. At all
times the new file would generate and refresh a TOC. I got to my
final peeling, when Word then said "Too many edits. Save your
work". It wouldn't accept the pasting. Never saw that before.
Love Ms's helpful error descriptions.

I closed all instances of Word, thinking it was a memory issue
(very able computer here). Reopened the target file and tried to
paste the clipboard; same error. But was able to paste the text
into a separate, shorter file.

I remain completely baffled by this behavior. There shouldn't be
any corruption in the early text I was trying to paste.

Thanks much for giving it a try.

Paul
 
T

Terry Farrell

Paul

I double-checked this. I downloaded a fresh copy of it and used File, Open &
Repair. This actually fixed the problem and the TOC displayed immediately it
opened. I have refreshed the TOC several times and it is still absolutely
100% solid.

Terry
 
P

Paul B

Beats me, what's going on. I just opened the file via Open and
Repair. The TOC was present. When I refreshed I immediately got
the "no TOC entries found" error.

p.
 
T

Terry Farrell

Very weird. Try this test.

Open Word in Safe Mode: from Start, Run, type in

winword /a

and press enter. Once Word is running, use the File, Open, Open and Repair
option again. Does the TOC still fail after refreshing?

Terry
 
P

Paul B

Some strange behavior here. First, I tried your suggestion. I was
able to refresh the TOC multiple times without problem (although
subsequent tries brought the warning "insufficient memory; Word
will not be able to undo").

Then I opened the file normally. I refreshed the TOC again a
couple of times. No problem.

Then I tried refreshing it the way I have been doing - and here
I need to apologize for not stating earlier that most, though not
all, of my testing has been done this way - via the following
macro:

WordBasic.GotoTableOfContents
With ActiveDocument
.TablesOfContents(1).Delete
.TablesOfContents.add Range:=Selection.Range,
RightAlignPageNumbers:= _
True, UseHeadingStyles:=True, UpperHeadingLevel:=1, _
LowerHeadingLevel:=6, IncludePageNumbers:=True,
AddedStyles:="", _
UseHyperlinks:=True, HidePageNumbersInWeb:=True,
UseOutlineLevels:= _
True
.TablesOfContents(1).TabLeader = wdTabLeaderDots
.TablesOfContents.Format = wdIndexIndent
End With

End Sub

The macro brought the error back. A second try was similar.

If that were the whole story, it would be pretty clear - the
macro would be at fault. But here's the confounding thing. At
this point I again tried to refresh (actually, create, since
there was no TOC to replace at this point) the TOC via the menus.
The error was persistent.

That's the kind of behavior I've been experiencing all along with
this problem - apparently inconsistent. If the macro is the
problem, why does it work on all my other files (some of them
equally large and maybe larger than this file), and once the
problem occurs why does it persist even when going via the menu
functions?

I'd brute force the thing - copy and paste the text into a new
file, but that hasn't worked either. Right now I'm stuck.

At any rate, thanks for your efforts thus far.

Paul
 
T

Terry Farrell

Paul

This may be a silly question, but what is the macro trying the achieve that
GoToTOC and F9 doesn't achieve?

Terry
 
P

Paul B

Paul

This may be a silly question, but what is the macro trying the achieve that
GoToTOC and F9 doesn't achieve?


Not a thing, except it does it with one click on my custom
floating toolbar. But F9 is a much more direct and elegant way to
refresh the TOC (my long way was based on recording a macro), and
it turns out that using this macro:

WordBasic.GotoTableOfContents
Selection.Fields.Update


seems to eliminate the problem! Let me live with this a day or so
to make sure, and I need to add all the data back into one file
and then test, then I'll get back to confirm or not.

Thanks,
Paul
 

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