Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Wed, 15 Oct 2008 00:37:46 +0100,    group: microsoft.public.word.vba.general        back       


.dot file to add references via AutoExex?   
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
date: Wed, 15 Oct 2008 00:37:46 +0100   author:   RB Smissaert

Re: .dot file to add references via AutoExex?   
"RB Smissaert"  wrote in message 
news:OCV6xXlLJHA.5692@TK2MSFTNGP04.phx.gbl...
> 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.


-- 
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
date: Wed, 15 Oct 2008 16:23:12 +0100   author:   Jonathan West

Re: .dot file to add references via AutoExex?   
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



"Jonathan West"  wrote in message 
news:OTX4fotLJHA.468@TK2MSFTNGP06.phx.gbl...
>
> "RB Smissaert"  wrote in message 
> news:OCV6xXlLJHA.5692@TK2MSFTNGP04.phx.gbl...
>> 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.
>
>
> -- 
> Regards
> Jonathan West - Word MVP
> www.intelligentdocuments.co.uk
> Please reply to the newsgroup
>
date: Wed, 15 Oct 2008 20:16:43 +0100   author:   RB Smissaert

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us