Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
kjo2281 kjo2281 is offline
external usenet poster
 
Posts: 1
Default How do I enter a calendar in a field for a form created in Word.

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   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How do I enter a calendar in a field for a form created in Word.

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Supressing Enter in a form field Kevin B Microsoft Word Help 2 September 20th 06 08:55 PM
Calendar Created in Word with Calendar Wizard HarleyD Page Layout 0 May 19th 06 03:41 PM
Is there a way to enter bullets in a word template text form field Kat55 Tables 1 November 11th 05 12:34 PM
How do I insert a calendar as a form field for the user to choose. Patty Microsoft Word Help 1 January 27th 05 02:48 AM
How do I create a drop down calendar field a form sml28 Microsoft Word Help 2 December 9th 04 01:22 PM


All times are GMT +1. The time now is 04:30 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"