Adding a commandbar and autorunning
Reham you asked me the following:
> Thanks for your help....I tried your code and it works fine
> but I need to ask you ....If I made macros in the VBA
> and I would like to assign it to a menu in word automatically and make
> process of setup to be run automatically instead of importng it
> from(file....import macro)..so all the macro will be in the default
> template automatically
> Is it possible to do it?
> Thank you once again
> Reham elgammal
> Testing department
For installing you could either use the autorun commands but you can also
create a new normal template which also contains the toolbar and the macro
For Excel there are a few autorun events, for word I don't know which are
available but they could be the same also.
User opens the workbook containing the procedure
User closes the workbook containing the procedure
User installs the add-in that contains the procedure, or the Installed property
of the add-in is set to True.
User removes the add-in that contains the procedure or the Installed property
of the add-in is set to False.
You could use the AutoOpen like this for instance:
cmdbarName = "Enter the commandbar name here..."
' The next line s check if the commandbar already exists else it is created
For i = 1 To CommandBar.Count
If CommandBar.Name = cmdbarName Then
Though I welcome e-mail, please post messages in this tread so everybody
can read them and comment on them.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center