The following code finds a date field in the
active document and unlinks it, to leave
the current year as text:
...
Selection.GoTo What:=wdGoToField, Name:="Date"
Selection.Fields.Unlink
...
Additionally, the same date field appears in the footer of
the last page of the active document. I wrote this
code to find and unlink it:
...
Selection.GoTo What:=wdGoToPage, Which:=wdGoToLast
With ActiveDocument.ActiveWindow.View
.Type = wdPrintView
.SeekView = wdSeekCurrentPageFooter
End With
Selection.GoTo What:=wdGoToField, Name:="Date"
Selection.Fields.Unlink
However, it doesn't select the fields, and, consequently,
it doesn't unlink it. What am I missing? Or is this simply
not possible?
I hope I've been clear. Thanks for your consideration.
Aaron
Doug Robbins - Word MVP - 10 Jan 2006 18:59 GMT
Use:
Dim afield As Field
For Each afield In ActiveDocument.Fields
If afield.Type = wdFieldDate Then
afield.Unlink
End If
Next afield

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> The following code finds a date field in the
> active document and unlinks it, to leave
[quoted text clipped - 25 lines]
>
> Aaron
Aaron Babel - 11 Jan 2006 15:32 GMT
Much appreciated, Doug.
I've left the "Record Macro" stage about a year ago,
so I'm in that in-between stage of learning how to
optimize my code. Thanks for sharing with me a view
of the "other" side of "General Simplicity." You've been
credited in my code comments.
Aaron
> Use:
>
[quoted text clipped - 34 lines]
> >
> > Aaron