Load Macro on startup

R

rael_lucid

Hi,

I have written some VBA code which does the following:
1) checks if a custombar exists;
2) if not, adds it
3) adds a combobox to the custombar

all is working well on my PC. I now want it to load whenever the user opens
MS Word. I am looking for something similar to MS Excel's Add-In file format
(xla), but am a little lost.

Can someone point me in the direction of a step-by-step guide for doing
something like this?

Rael
 
K

Karl E. Peterson

rael_lucid said:
Hi,

I have written some VBA code which does the following:
1) checks if a custombar exists;
2) if not, adds it
3) adds a combobox to the custombar

all is working well on my PC. I now want it to load whenever the user
opens MS Word. I am looking for something similar to MS Excel's
Add-In file format (xla), but am a little lost.

Can someone point me in the direction of a step-by-step guide for
doing something like this?

I could be mistaken, but I believe the closest you'll get is Normal.DOT?
 
R

rael_lucid

I have always thought that you should not touch Normal.dot. I have added it
to a template and included the file in the startup folder. The file loads (I
can see the reference to it in the VBA editor), but the macro does not run -
it is part of the Document_Open event.
Moving the code to Normal.dot seems to do the trick, but am hoping for
another method because this solution is going to be installed on numerous
machine which may have slightly different Normal.dot files.

Rael
 
J

Jezebel

For Word, any .dot file in the STARTUP folder is loaded automatically as an
add-in. To run the macro automatically when the add-in is loaded (ie when
Word starts) name the macro AutoExec(), or name it Main() in module named
AutoExec.
 
R

rael_lucid

Perfect... thank you Jezebel.

Rael

Jezebel said:
For Word, any .dot file in the STARTUP folder is loaded automatically as an
add-in. To run the macro automatically when the add-in is loaded (ie when
Word starts) name the macro AutoExec(), or name it Main() in module named
AutoExec.
 
I

ingrid makkinje

Hi Rael,
I have placed a .dot file in the start up folder, included a vba module
starting with
Sub AutoExec()
 
I

ingrid makkinje

Hi Rael,
I have placed a .dot file in the start up folder, included a vba module
starting with
Sub AutoExec()

Ingrid
 
R

rael_lucid

Hi again,

A minor problem has surfaced when I installed the solution on my client's
workstations. It occurs when the client is using MS Word as their Outlook
mail editor (most of them). Typically, they will open MS Outlook at the start
of the day and leave it open all day. When they open MS Word, if Outlook is
open, then the toolbar does NOT appear.

Ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top