Page is a vague concept in Word and the whole point of headers is that they produce the same content across a range of pages. How easy what you intend will be to do is determined by how the document is currently set up. How have you created the new pages?
If you were starting from scratch, you could use a macro to create the 365 pages using next page section breaks and add the date to the header of each section. The following macro will do that - note that it will take a while to run as it has to separately
process 365 pages!
If you need it to work with your existing document we would need to know more about what it contains, how the separate pages were created and what is already present in the header.
http://www.gmayor.com/installing_macro.htm
Option Explicit
Sub Create365DatedPages()
Dim i As Long
Dim oDoc As Document
Dim oSection As Section
Dim oHeader As HeaderFooter
Dim sDay As String
Dim sOrd As String
Dim dDate As Date
Dim oRng As Range
Set oDoc = Documents.Add
For i = 1 To 364
oDoc.Range.InsertBreak wdSectionBreakNextPage
Next i
For Each oSection In oDoc.Sections
dDate = Date + oSection.Index - 1
sDay = Format(dDate, "dd")
Select Case Right(sDay, 1)
Case Is = 1
If Left(sDay, 1) = 1 Then
sOrd = "th"
Else
sOrd = "st"
End If
Case Is = 2
If Left(sDay, 1) = 1 Then
sOrd = "th"
Else
sOrd = "nd"
End If
Case Is = 3
If Left(sDay, 1) = 1 Then
sOrd = "th"
Else
sOrd = "rd"
End If
Case Is = 4, 5, 6, 7, 8, 9, 0
sOrd = "th"
Case Else
End Select
oSection.Headers(wdHeaderFooterPrimary).LinkToPrevious = False
Set oRng = oSection.Headers(wdHeaderFooterPrimary).Range
With oRng
.Font.name = "Times New Roman"
.Font.Size = 18
.Font.Italic = True
.Text = Format(dDate, "d")
.Start = oSection.Headers(wdHeaderFooterPrimary).Range.End
.Text = sOrd
.Font.Superscript = True
.Start = oSection.Headers(wdHeaderFooterPrimary).Range.End
.Text = Format(dDate, " MMMM yyyy")
.Font.Superscript = False
End With
Next oSection
End Sub
<jeanmhealy> wrote in message news:*** Email address is removed for privacy ***...
I need to add the date in a header of a word document - this document is 365 pages long - one page for each day of the year, and at present, am changing dates manually which is very time consuming.
The set up is a workbook, so month by month would probably be easier - is it possible to insert a date for a month in the format 1st July 2010 - through to 31st - and so on for each month
I hope this makes sense
I would be really grateful for any help with this
Many thanks
Jean
Graham Mayor - Word MVP
www.gmayor.com
Posted via the Communities Bridge
http://communitybridge.codeplex.com/