It is a bit complicated to do this well - however most of the work has been
done for you in the first part of
http://www.fontstuff.com/word/wordtut03a.htm, however it needs a small
change to one of the macros to get it to relate to your form
Let's assume that the date you wish to pick is going to go in form field
Text2
Run the macro OpenCalendar() on entry to the field Text2
Change the macro
Private Sub Calendar1_Click to read
Private Sub Calendar1_Click()
Dim oFld As FormFields
Set oFld = ActiveDocument.FormFields
oFld("Text2").Result = Format(Calendar1.Value, "dd mmmm yyyy")
' Selection.Text = Format(Calendar1.Value, "dd mmmm yyyy")
' Selection.MoveRight Unit:=wdCharacter, Count:=1
Unload Me
End Sub
(I have left in the old lines for reference)
The calendar pops up as you tab into the field Text2 and shows any date
already present in the field or the current date. You can modify this
behaviour eg if you wish to set the start date as 30 days hence, you can
modify the following module:
Private Sub UserForm_Initialize()
'If IsDate(Selection.Text) Then
' Calendar1.Value = DateValue(Selection.Text)
'Else
Calendar1.Value = Date + 30
'End If
End Sub
The Word 2003 version of the MSCAL.OCX file referred to in the web page will
also work with Word 2007.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>