Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
I am creating a form to send home with my students everyday. I have created
fields with drop down lists for all the different categories. I wanted a field that has a calendar help, that will pop up a calendar for the user to choose the date on the calendar |
#2
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
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 Word MVP web site http://word.mvps.org kjo2281 wrote: I am creating a form to send home with my students everyday. I have created fields with drop down lists for all the different categories. I wanted a field that has a calendar help, that will pop up a calendar for the user to choose the date on the calendar |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Supressing Enter in a form field | Microsoft Word Help | |||
Calendar Created in Word with Calendar Wizard | Page Layout | |||
Is there a way to enter bullets in a word template text form field | Tables | |||
How do I insert a calendar as a form field for the user to choose. | Microsoft Word Help | |||
How do I create a drop down calendar field a form | Microsoft Word Help |