Fields Property Example

This example updates all the fields in the active document.

ActiveDocument.Fields.Update

This example removes all the fields from the main text story and the footer in the active document.

For Each aField in ActiveDocument.Fields
    aField.Delete
Next aField
Set myRange = ActiveDocument.Sections(1).Footers _
    (wdHeaderFooterPrimary).Range
For Each aField In myRange.Fields
    aField.Delete
Next aField

This example adds a DATE field at the insertion point.

With Selection
    .Collapse Direction:=wdCollapseStart
    .Fields.Add Range:=Selection.Range, Type:=wdFieldDate
End With

This example adds a mail merge field named "Title" at the insertion point.

Selection.Collapse Direction:=wdCollapseStart
ActiveDocument.MailMerge.Fields.Add Range:= Selection.Range, _
    Name:= "Title"