Computer Forum Forum Index
Register  FAQ Profile Log in to check your private messages Log in Register 

convert excel vba into word vba?

 
Post new topic   Reply to topic    Computer Forum Forum Index -> word vba customization
View previous topic :: View next topic  
Author Message
PDF Programmer
Guest





PostPosted: Thu Oct 04, 2007 6:23 pm    Post subject: convert excel vba into word vba? Reply with quote

I've got the code for an Excel popup utility that adds a date entry
option to the command bar. I'm trying to figure out how to convert
it
to work within a Word document. Can anybody help me convert the
code? Here it is from Excel:

' append the date entry option to the default command bar when
worksheet opens
Private Sub Workbook_Open()
Dim NewControl As CommandBarControl
' Assign shortcut to display calendar on SHIFT+CTRL+C
Application.OnKey "+^{C}", "Module1.OpenCalendar"
' Add item to shortcut menu on open
On Error Resume Next
Application.CommandBars("Cell").Controls("Insert Date").Delete
On Error GoTo 0
Set NewControl = Application.CommandBars("Cell").Controls.Add
With NewControl
.Caption = "Insert Date"
.OnAction = "Module1.OpenCalendar"
.BeginGroup = True
End With
End Sub


'remove the date entry option from the default command bar right
before doc closes
Private Sub Workbook_BeforeClose(Cancel As Boolean)
' Delete item from shortcut menu on close
On Error Resume Next
Application.CommandBars("Cell").Controls("Insert Date").Delete
End Sub
Back to top
Google
Sponsor





PostPosted: Thu Oct 04, 2007 6:23 pm    Post subject: Advertisement

Back to top
Jean-Guy Marcil
Guest





PostPosted: Fri Oct 05, 2007 3:53 am    Post subject: Re: convert excel vba into word vba? Reply with quote

PDF Programmer was telling us:
PDF Programmer nous racontait que :

Quote:
I've got the code for an Excel popup utility that adds a date entry
option to the command bar. I'm trying to figure out how to convert
it
to work within a Word document. Can anybody help me convert the
code? Here it is from Excel:

Already answered in vba.general.

Please do not multi-post.

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Computer Forum Forum Index -> word vba customization All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Computer Forum