Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2004

Tip: Looking for answers? Try searching our database.

Updating my index with a Macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
João Correia - 17 Nov 2004 11:11 GMT
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

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.