Hi:
This is an example of the kind of template I am trying to create:
July 23, 2007 to July 27, 2007
MONDAY - 23
TUESDAY - 24
WEDNESDAY - 25
THURSDAY - 26
FRIDAY - 27
DR. ASSIGNMENT
I would like the user to be able to input the beginning date (for example
"July 23, 2007" ) and have the rest of the fields automatically populate,
i.e., have the "to July 27, 2007" field populate by adding 5 days to the
beginning date; have Monday's date be extracted from the beginning date; and
Tuesday's date be extracted from the beginning date by adding 1, Wednesday
by adding 2, etc.
Is this possible??? Any guidance on how would be greatly appreciated.
Gratefully,
Linda
Doug Robbins - Word MVP - 22 Jul 2007 08:37 GMT
For the following macro, which you would set to run on exit from the
formfield into which the user enters the starting date, I have given
meaningful bookmark names to each of the formfields
Dim sdate As Date
Dim sday As Integer
With ActiveDocument
If IsDate(.FormFields("Start").Result) Then
sdate = .FormFields("Start").Result
sday = Format(sdate, "d")
.FormFields("Finish").Result = Format(DateAdd("d", 4, sdate), "MMMM
dd, yyyy")
.FormFields("Monday").Result = "Monday " & Format(sday, "0#")
.FormFields("Tuesday").Result = "Tuesday " & Format(sday + 1, "0#")
.FormFields("Wednesday").Result = "Wednesday " & Format(sday + 2,
"0#")
.FormFields("Thursday").Result = "Thursday " & Format(sday + 3,
"0#")
.FormFields("Friday").Result = "Friday " & Format(sday + 4, "0#")
Else
MsgBox "You did not input a valid date."
End If
End With

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:
> This is an example of the kind of template I am trying to create:
[quoted text clipped - 20 lines]
> Gratefully,
> Linda