InsertDateTime Method Example

This example inserts a TIME field for the current date. A possible result might be "November 18, 1999."

Selection.InsertDateTime DateTimeFormat:="MMMM dd, yyyy", _
    InsertAsField:=True

This example inserts the current date at the end of the active document. A possible result might be "01/12/99."

With ActiveDocument.Content
    .Collapse Direction:=wdCollapseEnd
    .InsertDateTime DateTimeFormat:="MM/dd/yy", _
        InsertAsField:=False
End With

This example inserts a TIME field for the current date in the footer for the active document.

ActiveDocument.Sections(1).Footers(wdHeaderFooterPrimary).Range _
    .InsertDateTime DateTimeFormat:="MMMM dd, yyyy", _
    InsertAsField:=True