Hi, I'm trying to create a Macro that updates my table of
contents and all my cross references in the text.
So, I recorded this Macro:
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 17-11-2004 by jbc
'
Selection.WholeStory
Selection.Fields.Update
End Sub
The problem is that my index is only updated in the page
numbers. If I have a new title in my text, it
doesn't "comes" (can I write this?!? :-)) in the index.
I'd like my macro to have the behavior that I get when
I "select all" and type "F9" to update fields.
Anyone with some tip?
Thanks,
João
Jonathan West - 17 Nov 2004 11:21 GMT
Hi João
If you want to be thorough, I would do something like this
Dim oField as Field
Dim oToc As TableOfContents
For each oField in ActiveDocument.Range.Fields
oField.Update
Next oField
For each oToc in ActiveDocument.Range.TablesOfContents
oToc.Update
Next oToc

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Hi, I'm trying to create a Macro that updates my table of
contents and all my cross references in the text.
So, I recorded this Macro:
Sub Macro2()
'
' Macro2 Macro
' Macro recorded 17-11-2004 by jbc
'
Selection.WholeStory
Selection.Fields.Update
End Sub
The problem is that my index is only updated in the page
numbers. If I have a new title in my text, it
doesn't "comes" (can I write this?!? :-)) in the index.
I'd like my macro to have the behavior that I get when
I "select all" and type "F9" to update fields.
Anyone with some tip?
Thanks,
João