The following is the code copied from my own PC - which also shows the code
to insert the date into a form. This inserts the date at the cursor (or in
form field Text1). Apart from the local date formatting switch, it looks the
same as yours?
Private Sub Calendar1_Click()
'Dim oFld As FormFields
'Set oFld = ActiveDocument.FormFields
'oFld("Text1").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
Private Sub CmdClose_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()
If IsDate(Selection.Text) Then
Calendar1.Value = DateValue(Selection.Text)
Else
Calendar1.Value = Date
End If
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>