Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Pop-up Calendar won't insert date into document
I created a pop-up calendar and made it a toolbar option. Calendar displays,
I can seletct mm, dd, yyyy, but it doesn't insert the date. Any clue why it won't insert? I've copied all the code from the fontstuff.com website. |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Pop-up Calendar won't insert date into document
Someone is more likely to be able to help you if you were to copy and paste
the code that YOU are using into a message that you post here. -- 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 "JFREE223" wrote in message ... I created a pop-up calendar and made it a toolbar option. Calendar displays, I can seletct mm, dd, yyyy, but it doesn't insert the date. Any clue why it won't insert? I've copied all the code from the fontstuff.com website. |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Pop-up Calendar won't insert date into document
Thanks Doug,
The userform code is Private Sub Calendar1_Click() Selection.Text = Format(Calendar1.Value, "mmmm dd, 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 The formcalendar code is Private Sub Calendar1_Click() End Sub Private Sub cmdClose_Click() Unload Me End Sub Private Sub UserForm_Click() End Sub Any help is appreciated. "Doug Robbins - Word MVP" wrote: Someone is more likely to be able to help you if you were to copy and paste the code that YOU are using into a message that you post here. -- 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 "JFREE223" wrote in message ... I created a pop-up calendar and made it a toolbar option. Calendar displays, I can seletct mm, dd, yyyy, but it doesn't insert the date. Any clue why it won't insert? I've copied all the code from the fontstuff.com website. |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Pop-up Calendar won't insert date into document
See http://www.gmayor.com/popup_calendar.htm which you might find easier to
follow. I can't see the deliberate mistake - The code that you have should insert the date at the cursor position when you call the userform. If you want to insert the date in an on-line form field the code needs to be modified. What, if anything, is happening when you call the form? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org JFREE223 wrote: Thanks Doug, The userform code is Private Sub Calendar1_Click() Selection.Text = Format(Calendar1.Value, "mmmm dd, 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 The formcalendar code is Private Sub Calendar1_Click() End Sub Private Sub cmdClose_Click() Unload Me End Sub Private Sub UserForm_Click() End Sub Any help is appreciated. "Doug Robbins - Word MVP" wrote: Someone is more likely to be able to help you if you were to copy and paste the code that YOU are using into a message that you post here. -- 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 "JFREE223" wrote in message ... I created a pop-up calendar and made it a toolbar option. Calendar displays, I can seletct mm, dd, yyyy, but it doesn't insert the date. Any clue why it won't insert? I've copied all the code from the fontstuff.com website. |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Pop-up Calendar won't insert date into document
It opens the calendar in my word doc when I select the calendar button on the
toolbar. Everything looks great, I select the date, it doesn't do anything at that point. It's like flicking a light switch and nothing happens. "Graham Mayor" wrote: See http://www.gmayor.com/popup_calendar.htm which you might find easier to follow. I can't see the deliberate mistake - The code that you have should insert the date at the cursor position when you call the userform. If you want to insert the date in an on-line form field the code needs to be modified. What, if anything, is happening when you call the form? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org JFREE223 wrote: Thanks Doug, The userform code is Private Sub Calendar1_Click() Selection.Text = Format(Calendar1.Value, "mmmm dd, 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 The formcalendar code is Private Sub Calendar1_Click() End Sub Private Sub cmdClose_Click() Unload Me End Sub Private Sub UserForm_Click() End Sub Any help is appreciated. "Doug Robbins - Word MVP" wrote: Someone is more likely to be able to help you if you were to copy and paste the code that YOU are using into a message that you post here. -- 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 "JFREE223" wrote in message ... I created a pop-up calendar and made it a toolbar option. Calendar displays, I can seletct mm, dd, yyyy, but it doesn't insert the date. Any clue why it won't insert? I've copied all the code from the fontstuff.com website. |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Pop-up Calendar won't insert date into document
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 Word MVP web site http://word.mvps.org JFREE223 wrote: It opens the calendar in my word doc when I select the calendar button on the toolbar. Everything looks great, I select the date, it doesn't do anything at that point. It's like flicking a light switch and nothing happens. "Graham Mayor" wrote: See http://www.gmayor.com/popup_calendar.htm which you might find easier to follow. I can't see the deliberate mistake - The code that you have should insert the date at the cursor position when you call the userform. If you want to insert the date in an on-line form field the code needs to be modified. What, if anything, is happening when you call the form? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org JFREE223 wrote: Thanks Doug, The userform code is Private Sub Calendar1_Click() Selection.Text = Format(Calendar1.Value, "mmmm dd, 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 The formcalendar code is Private Sub Calendar1_Click() End Sub Private Sub cmdClose_Click() Unload Me End Sub Private Sub UserForm_Click() End Sub Any help is appreciated. "Doug Robbins - Word MVP" wrote: Someone is more likely to be able to help you if you were to copy and paste the code that YOU are using into a message that you post here. -- 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 "JFREE223" wrote in message ... I created a pop-up calendar and made it a toolbar option. Calendar displays, I can seletct mm, dd, yyyy, but it doesn't insert the date. Any clue why it won't insert? I've copied all the code from the fontstuff.com website. |
#7
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Pop-up Calendar won't insert date into document
Thanks. I found this today. When I press F8 and run through the code on my
userform for initialize, I get a "runtime error '13' Type Mismatch." It occurs on the third line of the code below... Private Sub UserForm_Initialize() If IsDate(Selection.Text) Then Calendar1.Value = DateValue(Selection.Text) Else Calendar1.Value = Date End If End Sub "Graham Mayor" wrote: 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 Word MVP web site http://word.mvps.org JFREE223 wrote: It opens the calendar in my word doc when I select the calendar button on the toolbar. Everything looks great, I select the date, it doesn't do anything at that point. It's like flicking a light switch and nothing happens. "Graham Mayor" wrote: See http://www.gmayor.com/popup_calendar.htm which you might find easier to follow. I can't see the deliberate mistake - The code that you have should insert the date at the cursor position when you call the userform. If you want to insert the date in an on-line form field the code needs to be modified. What, if anything, is happening when you call the form? -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org JFREE223 wrote: Thanks Doug, The userform code is Private Sub Calendar1_Click() Selection.Text = Format(Calendar1.Value, "mmmm dd, 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 The formcalendar code is Private Sub Calendar1_Click() End Sub Private Sub cmdClose_Click() Unload Me End Sub Private Sub UserForm_Click() End Sub Any help is appreciated. "Doug Robbins - Word MVP" wrote: Someone is more likely to be able to help you if you were to copy and paste the code that YOU are using into a message that you post here. -- 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 "JFREE223" wrote in message ... I created a pop-up calendar and made it a toolbar option. Calendar displays, I can seletct mm, dd, yyyy, but it doesn't insert the date. Any clue why it won't insert? I've copied all the code from the fontstuff.com website. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Unable to insert date into Word document | Microsoft Word Help | |||
Insert current date plus 120 days into a Word document? | Microsoft Word Help | |||
Insert date document was last accessed in that document? | Microsoft Word Help | |||
How do i insert future date ina word document | Microsoft Word Help | |||
Can I insert a revision date to a Word document header? | Microsoft Word Help |