Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
JFREE223 JFREE223 is offline
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
JFREE223 JFREE223 is offline
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
JFREE223 JFREE223 is offline
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
JFREE223 JFREE223 is offline
external usenet poster
 
Posts: 4
Default 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

Posting Rules

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to insert date into Word document Lynne Microsoft Word Help 3 January 28th 08 10:22 AM
Insert current date plus 120 days into a Word document? msuerick Microsoft Word Help 1 October 9th 06 11:14 PM
Insert date document was last accessed in that document? Confused Microsoft Word Help 1 May 5th 06 03:51 PM
How do i insert future date ina word document Codeed Microsoft Word Help 1 October 27th 05 06:50 AM
Can I insert a revision date to a Word document header? dinot Microsoft Word Help 3 February 15th 05 05:59 PM


All times are GMT +1. The time now is 08:57 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"