-
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
> the
> process of setup to be run automatically instead of importng it
> from(file....import macro)..so all the macro will be in the default
> normal
> template automatically
> Is it possible to do it?
>
> Thank you once again
>
> Reham elgammal
>
> Testing department
My solution:
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
code.
For Excel there are a few autorun events, for word I don't know which are
available but they could be the same also.
Auto_Open
User opens the workbook containing the procedure
Auto_Close
User closes the workbook containing the procedure
Auto_Add
User installs the add-in that contains the procedure, or the Installed property
of the add-in is set to True.
Auto_Remove
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:
Sub Auto_Open()
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
Exit For
Else
CommandBar.Add (cmdbarName)
Next i
End Sub
Good luck!
Jonathan
Though I welcome e-mail, please post messages in this tread so everybody
can read them and comment on them.
-
Re: Adding a commandbar and autorunning
"Jonathan Martens" <j.martens@student.utwente.nl> wrote:
>
>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
>> the
>> process of setup to be run automatically instead of importng it
>> from(file....import macro)..so all the macro will be in the default
>> normal
>> template automatically
>> Is it possible to do it?
>>
>> Thank you once again
>>
>> Reham elgammal
>>
>> Testing department
>
>My solution:
>
>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
>code.
>
>For Excel there are a few autorun events, for word I don't know which are
>available but they could be the same also.
>
>Auto_Open
>User opens the workbook containing the procedure
>
>Auto_Close
>User closes the workbook containing the procedure
>
>Auto_Add
>User installs the add-in that contains the procedure, or the Installed property
>of the add-in is set to True.
>
>Auto_Remove
>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:
>
>Sub Auto_Open()
> 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
> Exit For
> Else
> CommandBar.Add (cmdbarName)
> Next i
>End Sub
>
>Good luck!
>
>Jonathan
>
>Though I welcome e-mail, please post messages in this tread so everybody
>can read them and comment on them.
-
Re: Adding a commandbar and autorunning
Hi Jonthon
Thanks for your reply..I think you understand me wrong
What I am searching for is a way to distrbute my macro all over the company
So if I make this macro via VB6 I will compile to a standard EXE
So everybody can use the program and can use it but in case of making
this via "VBA" in word2000 so every body should do the following steps"-
1:- open word
2:-tool....macro....VBeditor
3:- file...import macro"tothe default normal.dot"
o this is a tough process..so I am seaching for away to import macro
automatically in the "visual basic editor" in normal.dot
Thank you once again
you have been very helpful
"Jonathan Martens" <j.martens@student.utwente.nl> wrote:
>
>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
>> the
>> process of setup to be run automatically instead of importng it
>> from(file....import macro)..so all the macro will be in the default
>> normal
>> template automatically
>> Is it possible to do it?
>>
>> Thank you once again
>>
>> Reham elgammal
>>
>> Testing department
>
>My solution:
>
>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
>code.
>
>For Excel there are a few autorun events, for word I don't know which are
>available but they could be the same also.
>
>Auto_Open
>User opens the workbook containing the procedure
>
>Auto_Close
>User closes the workbook containing the procedure
>
>Auto_Add
>User installs the add-in that contains the procedure, or the Installed property
>of the add-in is set to True.
>
>Auto_Remove
>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:
>
>Sub Auto_Open()
> 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
> Exit For
> Else
> CommandBar.Add (cmdbarName)
> Next i
>End Sub
>
>Good luck!
>
>Jonathan
>
>Though I welcome e-mail, please post messages in this tread so everybody
>can read them and comment on them.
-
A fascinating topic, I am recently doing some studies on the command bar. Is there any good guide for using the command bar control.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|