View Single Post
  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Date Field in Header

Following on from Suzanne's clever idea (which is much simpler than date
calculations - http://www.wopr.com/cgi-bin/w3t/show...?Number=249902) if
you used a combination of

{Date \@ "MM"}/{Page}/{Date \@ "yyyy"}
or
{ Page }{ Date \@"/MM/yyyy" }

and copy the form to create 31 page document, then add the following macro

Sub PrintAMonth()
Dim sPages As String
Dim sMonth As String
Dim sLeap As String

Start:
sMonth = InputBox("Print forms for which Month number 1 - 12?", _
"Print Forms", Format(Date, "M"))
sPages = "1-31"
If sMonth 12 Then
MsgBox "There are only 12 months in a year!", vbCritical, ""
GoTo Start:
End If
If sMonth = 2 Then
sLeap = MsgBox("Is this a leap year?", vbYesNo, "")
If sLeap = vbYes Then sPages = "1-29"
If sLeap = vbNo Then sPages = "1-28"
End If
If sMonth = 4 Then sPages = "1-30"
If sMonth = 6 Then sPages = "1-30"
If sMonth = 9 Then sPages = "1-30"
If sMonth = 11 Then sPages = "1-30"
'ActiveDocument.PrintOut Pages:=sPages
MsgBox sPages
End Sub


The macro will create the required number of dated forms each month.
--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Suzanne S. Barnhill wrote:
You could use the page number. For example, for July, you could use
7/{PAGE}/2007. You'd get a page for every day of the month, not just
the business days, but you wouldn't have to print all of them.


"
wrote in message
...
The company I work for has a form for logging when a room or locker
has been checked and/or cleaned. The form is printed out and
completed manually by the employees. Instead of printing up a form
each day, I would like to print an entire month. Is there a way to
have the date advance by one day in the header instead of going in
and manually changing the date each time I print?