Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Thu, 04 Oct 2007 11:23:00 -0700,    group: microsoft.public.word.vba.customization        back       


convert excel vba into word vba?   
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
date: Thu, 04 Oct 2007 11:23:00 -0700   author:   PDF Programmer

Re: convert excel vba into word vba?   
PDF Programmer was telling us:
PDF Programmer nous racontait que :

> 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
date: Thu, 4 Oct 2007 23:53:30 -0400   author:   Jean-Guy Marcil DontEvenTry@NoSpam

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us