PDA

View Full Version : Date field in Header



mdmackillop
08-17-2007, 05:44 AM
I'm creating a mail merge document from a template, which then merges to a new document for saving. I want to add the date into the second page header, which will not be updated when the saved document is reopened. I've used Forms field on page 1 to do this, but I can't insert this type of field into a header.
Any suggestions?

geekgirlau
08-20-2007, 09:06 PM
What about inserting the date somewhere in the document, flagging it with a bookmark and using the REF field in the header to bring up the results of that field? Alternatively you could create a custom document property and use the DOCPROPERTY field to display the results in the header.

fumei
08-22-2007, 07:34 AM
Hi Malcolm.

If the "second page" is the second page because you have Different first page.....Sub SecondPageDate()
ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Range _
.InsertDateTime DateTimeFormat:="d MMMM yyyy", InsertAsField:= _
False, DateLanguage:=wdEnglishUS, CalendarType:=wdCalendarWestern, _
InsertAsFullWidth:=False
End SubSetting InsertAsField = False means it will not update. You will have to adjust if you have other content in the header of course. The above just inserts the date.

mdmackillop
08-22-2007, 02:17 PM
Thanks both,
I'll give both solutions a try.
Regards
Malcolm