Outlook not firing AutoExec in a Word global template

K

koolnuts

I have a Word global template located in STARTUP that I am executing through
the AutoExec auto macro.

The problem I am having is that (as Outlook is my email editor) if I start
Outlook first before I start Word, the global template seems to be loading,
and the template is checked in the Templates and Addins under the Tools menu.
But unfortunately it does not seem to actually fire the AutoExec sub (in
which I have a MsgBox to let me know when that is being fired).

If I start Word first everything is fine, it is just when I start Outlook
first that this problem occurs.

I also have Application Events in this template that are working well under
Word.

Can someone help please?

Thanks in advance.
 
J

Jay Freedman

True, but so is a COM add-in written as a DLL. I don't know whether
that might have different rules about the equivalent of the AutoExec
procedure -- never tried it.

Personally, I think the whole idea of using Word as the Outlook editor
is an abomination; Outlook has a perfectly good editor of its own,
without the ton of troubles that the Word/Outlook interaction brings.
The few times I've wanted some Word-only feature in an email, I've
used either copy/paste or an attachment.
 
K

koolnuts

I have little knowledge of COM Addins or how to program for one. I have some
VB and VBA programming experience but don't remember having to create any COM
addins. I do have access to Developer, and I understand I can use that to
create an COM addin.

So, as I don't have much time to play around at the moment (especially if
ultimately it won't help me in this instance) but need to get a solution
happening soon, I am wondering if there is anyone who has experience with COM
addins and how they handle the AutoExec procedure, and if Outlook still
disables the AutoExec procedure from being fired when loading the COM addin -
if Outlook is load before Word?

Thanks for your help in advance.
 
T

Tom Winter

Just to clear up some terminology, COM Add-ins don't have an AutoExec
procedure, they have OnConnection and OnStartupComplete methods.

From some quick testing, the OnConnection method is called when Word is
started as the e-mail editor for Outlook, so this should do what you want.

On thing you might be intererested in is the first element of the Custom()
array passed to OnConnection. It indicates how Word was started. 1 for a
normal startup, 2 for embedded (e.g., a Word object in an Excel spreadsheet)
and 3 for Automation (which is what I believe Outlook uses, though I haven't
tested).

Here's an article to get you started:

How To Build an Office 2000 COM Add-In in Visual Basic
http://support.microsoft.com/?id=238228
 
K

koolnuts

Thanks to you all for your help.

Tom Winter said:
Just to clear up some terminology, COM Add-ins don't have an AutoExec
procedure, they have OnConnection and OnStartupComplete methods.

From some quick testing, the OnConnection method is called when Word is
started as the e-mail editor for Outlook, so this should do what you want.

On thing you might be intererested in is the first element of the Custom()
array passed to OnConnection. It indicates how Word was started. 1 for a
normal startup, 2 for embedded (e.g., a Word object in an Excel spreadsheet)
and 3 for Automation (which is what I believe Outlook uses, though I haven't
tested).

Here's an article to get you started:

How To Build an Office 2000 COM Add-In in Visual Basic
http://support.microsoft.com/?id=238228
 

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