Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 97: Date field in mail merge

Status
Not open for further replies.

Rob32

Technical User
Oct 14, 2002
18
NZ
Hi

I have a problem inserting a date into a word document. Normally I would insert a date field into a document, & make it update automatically. However, I am creating a template for a merge document, & getting the date to update automatically causes a problem, because when Word inserts the date field into the merged document, it keeps updating. What I want is for the field to update automatically in the template, but when it is merged, for the date to be inserted into the merged document as a non-updating field.

I have tried to do have the date inserted manually using a fill-in field, but can't see how to do this without using a macro. Our default Word setup is for the macro warning message to pop up, and because the documents I am creating will be used by a large number of people, I 'll start getting a bunch of irritated people knocking on my door if I use a macro.

Any help appreciated.

Thanks, Rob
 
Hi Rob,

Have you tried using the PRINTDATE field? This will display the date the document was last printed, which should work for your merge documents.

To insert the field, select Insert, Field, Date and Time, PrintDate (use the "Options" button to set the format of the date).

To make sure the field is automatically updated when you print, select Tools, Options, Print, Update Fields.

Hope this helps [reading]
 
Thanks GeekGirlau

I had tried that, and almost thought it was a solution. But...(& so often there is a "but") I need the document to show a date of when it was first printed, not subsequent printings. I also tried createdate, but that just carries the date the original document was created over into the merged document.

Also - I should have explained properly my problem with the fillin field. I want the fillin field dialog box to pop up automatically when the document opens, & I can't see how to do this without using a macro.

Cheers, Rob
 
Hmmm ...

I don't know the answer to the date field (you'd think they'd have a MergeDate field!), but yes, to update all the fields in the document you need a macro.

Press Alt-F11 to go to the VBA screen, and in the Project Explorer on the left, double-click on "ThisDocument" under the name of your template. Change the first drop-down at the top of the screen to "Document", and the second drop-down to "New". You need to select the whole document and update the fields - the code is as follows:

Selection.WholeStory
Selection.Fields.Update
Selection.MoveLeft Unit:=wdCharacter, Count:=1

This is the only way to get the Fillin field to pop up automatically in your template, so I'm afraid your users will just have to grin and bear it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top