View Single Post
 
Old 04-23-2020, 03:11 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

OK, try:
Code:
Sub RefreshFields()
Application.ScreenUpdating = False
Dim TOC As TableOfContents    ' Table of Contents Object
Dim TOA As TableOfAuthorities ' Table of Authorities Object
Dim TOF As TableOfFigures     ' Table of Figures Object
Dim Rng As Range              ' Range Object
Dim Idx As Index              ' Index Object
With ActiveDocument
  ' Loop through Story Ranges and update.
  ' Note that this may trigger interactive fields (eg ASK and FILLIN).
  For Each Rng In .StoryRanges
    Do
      Rng.Fields.Update
      Set Rng = Rng.NextStoryRange
    Loop Until Rng Is Nothing
  Next
  ' Loop through Tables Of Contents and update
  For Each TOC In .TablesOfContents
    TOC.Update
  Next
  ' Loop through Tables Of Authorities and update
  For Each TOA In .TablesOfAuthorities
    TOA.Update
  Next
  ' Loop through Tables Of Figures and update
  For Each TOF In .TablesOfFigures
    TOF.Update
  Next
  ' Loop through Indices and update
  For Each Idx In .Indexes
    Idx.Update
  Next
  .PrintPreview
  .ClosePrintPreview
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote