TOC and Field Update Macros

D

Deborah C

Hi All,

I had some 'Update All' Macros set up in all my document templates that have
suddenly stopped working. I've given up trying to figure out why now, I just
want to fix the problem. These templates are used as the basis for many
documents.

I'm on Word 2000 9.0.6926 SP3. Nothing has changed for me in years, but
other people in the office are starting to get XP - maybe that is making a
difference?

The macro that used to work was:
Selection.WholeStory
Selection.Fields.Update
Selection.HomeKey Unit:=wdStory

Now that doesn't seem to do much at all.

So I tried a different macro, but got "Run time error -2147467259
(800004005) Method 'update' of object 'table of contents' failed"
Sub UpdateAll()
Dim aStory As Range
Dim aField As Field
ActiveDocument.TablesOfContents(1).Update
For Each aStory In ActiveDocument.StoryRanges
For Each aField In aStory.Fields
aField.Update
Next aField
Next aStory
End Sub

If I take the TOC part out, it updates everything in the document except the
TOC.

Can anyone point me in the right direction here?
 
D

Deborah C

Never mind, I found the solution myself :)

One of the macros in the document was called UpdateFields - when I renamed
it all my problems went away!
 

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