Word AutoExec / Outlook Conflict

  • Thread starter Thread starter Paal Aaserud
  • Start date Start date
P

Paal Aaserud

Need help resolving Outlook's killing an AutoExec procedure/macro in a
global template. Here's the situation:

I need to have a bit of code run (from a global template)
everytime that Word opens.

I put the code in a "Sub Main" proc in a module
named "AutoExec", per Word VBA reference. The code runs
fine if Outlook is NOT running.

However, if Outlook is set to use Word as the email editor, AND if it is
running before starting Word on its own, the AutoExec code does not run.

Running Word XP SP2, Outlook XP SP2 (using Word as the Email editor).

Any suggestions or work-arounds?
 
Hi Paul,

Aside from the obvious of not using Word as the E-mail editor...

You could:
1. Move the code out of sub main to another sub (sub OldMain) and call it
from sub main. (Reason to come)
2. Alter that code so that it registers the completed action in a global
boolean variable.
3. Then when the actions of the Sub OldMain are needed in a different
module, test the value of the global boolean. If it comes back false, run
sub OldMain before proceeding.

JMO.

HTH and have a great day!

Steve
 
Well my problem is that the macro run, is placed in the \startup folder and
run an AutoExec macro to add a toolbar and a custom menu to word. I do not
have any control over the macro run.
 
You shouldn't need a macro to modify your toolbars and menus. If you always
want these to show either modify the toolbars in normal.dot, or create a
separate template with the toolbars modified and put it in Word's startup
folder.
 
Back
Top