Hi,
Sorry if this has been asked recently.
I want a macro to insert a customized date.
I understand that I can insert an unformatted date field with
.Fields.Add and Type:=wdFieldDate and then S&R the code inside the
field but I would like to directly insert a correctly formatted field.
I have tried to type the field code with Selection.Text = " ", but I
do not manage to get those special field brackets into the Editor.
TIA
Örjan
Jonathan West - 18 Mar 2008 10:51 GMT
> Hi,
>
[quoted text clipped - 11 lines]
> TIA
> Örjan
Hi Örjan
In the Fields.Add method, there is a Text parameter. Put your formatting
switches there.

Signature
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Doug Robbins - Word MVP - 18 Mar 2008 10:54 GMT
ActiveDocument.Fields.Add Selection.Range, wdFieldDate, "\@ " & Chr(34) &
"dd MMMM yyyy" & Chr(34)
will insert 18 March 2008 and the location of the Selection

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
> Hi,
>
[quoted text clipped - 11 lines]
> TIA
> Örjan
Oerjan - 18 Mar 2008 12:27 GMT
Thanks a lot.
Örjan
>ActiveDocument.Fields.Add Selection.Range, wdFieldDate, "\@ " & Chr(34) &
>"dd MMMM yyyy" & Chr(34)
>
>will insert 18 March 2008 and the location of the Selection
Edward Thrashcort - 18 Mar 2008 13:23 GMT
Try recording a macro while you add the field
Eddie
> *From:* Oerjan <nospam@fake.se>
> *Date:* Tue, 18 Mar 2008 10:34:39 +0100
[quoted text clipped - 14 lines]
> TIA
> Örjan