Word '03 doesn't find TOC entries

P

Paul B

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

Aha, I see the difference. Refresh does not add new entries to
the TOC, it just refreshes the existing entries. This is a
problem. Need to go back to the other way, replacing the TOC with
a new one.

p.
 
T

Terry Farrell

Hidden amongst Word's command is the GoToTOC command. You can drag that up
onto your toolbar. Then 1-click gets you back to the TOC. Press F9 once
refreshes only the page numbers, but if you press it again immediately, it
then offer to refresh the whole TOC. But another hidden command is
UpdateTableofContents... command. You can drag that to the Toolbar. Then at
least you only have 2 clicks!

Terry
 
P

Paul B

Hidden amongst Word's command is the GoToTOC command. You can drag that up
onto your toolbar. Then 1-click gets you back to the TOC. Press F9 once
refreshes only the page numbers, but if you press it again immediately, it
then offer to refresh the whole TOC. But another hidden command is
UpdateTableofContents... command. You can drag that to the Toolbar. Then at
least you only have 2 clicks!

Terry

Wow, thanks. Had no idea about those additional commands.

Your idea seemed to work, and there was no need to first navigate
to the TOC. So far, so good. So I attempted to macroize it, but
there was no way to spec "replace entire table" in VBA.

Out on the Web,
(http://microsoft-personal-applicati...lic.word.docmanagement/2011486/1/Default.aspx),
I came across this post by Jay Freedman:

-----------
Re: Update Table of Contents

You can't really change the default, but you can install this
macro and assign a toolbar button and/or keyboard shortcut to it.

Sub UpdateTableOfContents()
Dim toc As TableOfContents

For Each toc In ActiveDocument.TablesOfContents
toc.Update
Next
End Sub
-----------

This appears to work perfectly. Again, let me live with it a bit
and try to put that problem file back together for the ultimate
test. Will get back.

p.
 
T

Terry Farrell

Paul

Jay is a bit of a VBA guru. I.m please you found it. Between that and the
GotoTOC, it should get your editing back on track.

There are hundreds of hidden commands in Word. I once printed then out
(about 3 x A4 pages of them) and there are some real hidden gems in there.
Buit Equally htere are also many that I don't have an iota of their
function.

Terry
 
P

Paul B

Sub UpdateTableOfContents()
Dim toc As TableOfContents

For Each toc In ActiveDocument.TablesOfContents
toc.Update
Next
End Sub
-----------

This appears to work perfectly. Again, let me live with it a bit
and try to put that problem file back together for the ultimate
test. Will get back.

p.

Nope. Forgetting the TOC problem for a moment, I can't even paste
simple text into this document. I keep getting the error, "There
are too many edits in the document. This operation will be
incomplete. Save your work.", which is a totally bogus analysis.

Ms's answer to this problem is reproduced at
http://www.kbalertz.com/224029/edits.operation.aspx. Basically,
make sure there's enough unfragmented disk space available. I ran
scandisk and defrag, to no avail. I took a bunch of hyperlinks
out of text I was trying to paste, to no avail.

What a mess. There's a lot of formatting that stands to be lost
because of this fiasco.

p.
 
T

Terry Farrell

Paul

I don't think this is the case. I believe that what you are seeing is the
result of too many edits, etc., and your PC doesn't have the resources to
handle it. The problem is the whole document lacks any application of styles
except for Heading 3: the remainder is all direct formatting. The result is
that for a relatively small document, it has 198 different styles and over
2,300 paragraphs. I'm not experiencing your resources problems because I
have 4 GB dual-channel memory and a Core 2 Duo E6420.

You need to go through the document and remove all the unwanted end of line
paragraph breaks, then apply a sensible body text style. That will probably
eliminate 75% of the styles and 85% or the paragraphs. For help with ridding
those unwanted para breaks, see
http://www.word.mvps.org/FAQs/Formatting/CleanWebText.htm. Then once you
have decided on a standard body text style, you can assign a keyboard
command to apply that style to make it easier to edit the document. Edit
Heading 3 style so that the Body Text style follows it.

Terry
 
P

Paul B

Paul

I don't think this is the case. I believe that what you are seeing is the
result of too many edits, etc., and your PC doesn't have the resources to
handle it. The problem is the whole document lacks any application of styles
except for Heading 3: the remainder is all direct formatting. The result is
that for a relatively small document, it has 198 different styles and over
2,300 paragraphs. I'm not experiencing your resources problems because I
have 4 GB dual-channel memory and a Core 2 Duo E6420.

You need to go through the document and remove all the unwanted end of line
paragraph breaks, then apply a sensible body text style. That will probably
eliminate 75% of the styles and 85% or the paragraphs. For help with ridding
those unwanted para breaks, see
http://www.word.mvps.org/FAQs/Formatting/CleanWebText.htm. Then once you
have decided on a standard body text style, you can assign a keyboard
command to apply that style to make it easier to edit the document. Edit
Heading 3 style so that the Body Text style follows it.

Terry

Terry, what you're saying would explain the various error
messages. I've never had a machine limitation before. I have a 3
G processor with 1G of RAM. CPU usage usually hovers in the teens
or below with this file open. Page file is flat at 526M, with
Windows handling it dynamically.

Winword.exe, with this file alone open, was at 59M memory usage
and 34M VM while I was actively editing the file, but as I am
writing this has dropped to 2M/34M.

I'm in the process of cleaning up unnecessary paragraphs, and
I've turned off autorecover, but these small changes frequently
bring warnings about inability to restore back due to lack of
memory.

There is a text body style, and it's set to follow H3, but I
didn't apply it to all text copied into the file. Now when I
apply it retroactively, sometimes I lose markups, sometimes I
don't; it's confusing. I guess I need to convert everything to it
before marking up, going forward.

As for this file, I'll try to clean it up as best I can. If
necessary I'll split the thing; luckily it's not something that
has to stay in one piece. When the dust settles I'll let you know
how I made out.

Thanks again,
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