View Single Post
  #14   Report Post  
Posted to microsoft.public.word.docmanagement
Karen Karen is offline
external usenet poster
 
Posts: 204
Default Headers (the same but different for each section)


This is perfect! Thanks!!!! I really need to learn macros!
"Graham Mayor" wrote:

The following should hit everything

Sub Update()
Dim oField As Field
Dim oSection As Section
Dim oHeader As HeaderFooter
Dim oFooter As HeaderFooter
Dim oTOC As TableOfContents
Dim oFig As TableOfFigures
Dim oAut As TableOfAuthorities

For Each oTOC In ActiveDocument.TablesOfContents
oTOC.Update
Next oTOC

For Each oFig In ActiveDocument.TablesOfFigures
oFig.Update
Next oFig

For Each oAut In ActiveDocument.TablesOfAuthorities
oAut.Update
Next oAut

For Each oSection In ActiveDocument.Sections
For Each oHeader In oSection.Headers
If oHeader.Exists Then
For Each oField In oHeader.Range.Fields
oField.Update
Next oField
End If
Next oHeader
For Each oFooter In oSection.Footers
If oFooter.Exists Then
For Each oField In oFooter.Range.Fields
oField.Update
Next oField
End If
Next oFooter
Next oSection
End Sub


--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Karen wrote:
Hi, I am using Graham's macro as suggested by Jay, however, it
doesn't appear to update the Table of Contents, Tables, and Figures
that I have. It works great for the headers, footers, bookmarks,
fields, etc. Does anyone know a way to modify this macro in order for
it to update everything in the document? Thanks, Karen