Updating Fields

Updates all the fields in the collection

objFields.Update 

If a field is locked it can no longer be updated.


This example updates any fields in the active document that aren't updated automatically.

Dim objField As Field 
For Each objField In ActiveDocument.Fields
    If objField.LinkFormat.AutoUpdate = False Then
        objField.LinkFormat.Update
    End If
Next afield

In Header and Footer


Dim objHeader As HeaderFooter 
Dim objField As Field

   Set objHeader = Application.ActiveDocument.Sections(1).Headers(wdHeaderFooterIndex.wdHeaderFooterFirstPage)
   
   For Each objField In objHeader.Range.Fields
      objField.Update
   Next objField

Inside Text Boxes

   'ActiveDocument.Shapes(1).Name = "TB_HeaderLinking_DocReportTitle"
   ActiveDocument.Shapes.Item("TB_HeaderLinking_DocReportTitle").TextFrame.TextRange.Fields.Update


© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext