K
Karen
Hi, I can't find my original post it was a while ago where I was asking for
help on how to have a macro update my entire document (bookmarks, TOCs,
fields, headers, footers, etc.). Graham Mayor gave me a macro to use. It
worked great! I now have to create a new template which I based off of the
first one which had this macro attached to it. The macro isn't working like
it use to. When I click on the "Update All" button it doesn't update
anything. The macro that I have is posted below. Any help would be greatly
appreciated. Thanks, Karen
Sub UpdateAll()
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
help on how to have a macro update my entire document (bookmarks, TOCs,
fields, headers, footers, etc.). Graham Mayor gave me a macro to use. It
worked great! I now have to create a new template which I based off of the
first one which had this macro attached to it. The macro isn't working like
it use to. When I click on the "Update All" button it doesn't update
anything. The macro that I have is posted below. Any help would be greatly
appreciated. Thanks, Karen
Sub UpdateAll()
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