.dot file to add references via AutoExex?

R

RB Smissaert

Is it possible for a .dot template file to add references to it's own
project automatically when it is starting up
via an AutoExec procedure?
One problem with AutoExec (in a .dot file?) is that it doesn't fire when
Word was already running for example
as Outlook.

RBS
 
J

Jonathan West

RB Smissaert said:
Is it possible for a .dot template file to add references to it's own
project automatically when it is starting up
via an AutoExec procedure?
One problem with AutoExec (in a .dot file?) is that it doesn't fire when
Word was already running for example
as Outlook.

Yes, this is a known problem. The approach I take is to have the AutoExec
macro set a value in a global variable. Then, when any other macro in the
same add-in is run, it first checks the global variable, and if it hasn't
been set, run the AutoExec macro before proceeding further.
 
R

RB Smissaert

Sorry, I don't get this. If AutoExec runs to set the global variable then it
runs and there is no problem.
Could you elaborate a bit further? I am dealing here with the problem of
having references
to dll files that may have a different versions, so when the reference is
set with the saved .dot
file there will be problems when the dll is different.
In Excel I can deal with this problem by having a loaded .xla that opens
(but not loads, so not
showing as ticked under Tools, Add-ins) another .xla. The first one does the
preparation work
and then opens the main .xla. The main .xla can then add the references via
the Workbook_Open event.
I tried the same approach in Word, but it doesn't seem possible that way.

RBS
 

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