Problems with starting word with /t switch

B

BRC

I have a word template that contains autonew macro and some other
code. If, in Word, I select File New and select this template the code
behind the New event for the document get's fired - however, if I
create a shortcut which starts Word with the /t switch, I get a new
blank document based on the template but none of the code is executed.
Also, it prompts me to save the both the new doc and template each
time. Is anyone aware to a workaround for this? Thanks, BRC
 
J

Jean-Guy Marcil

BRC was telling us:
BRC nous racontait que :
I have a word template that contains autonew macro and some other
code. If, in Word, I select File New and select this template the code
behind the New event for the document get's fired - however, if I
create a shortcut which starts Word with the /t switch, I get a new
blank document based on the template but none of the code is executed.
Also, it prompts me to save the both the new doc and template each
time. Is anyone aware to a workaround for this? Thanks, BRC

This is because the Document_New event does not fire when Word first starts.
Try putting code in the Document_New event of the Normal.dot - when you
create a new document, it fires, but if you close Word and start it again,
it does not fire.

Test this with these in Normal.dot.

In the ThisDocument module:

'_______________________________________
Private Sub Document_New()

MsgBox "New!!!!!"

End Sub
'_______________________________________

and this one in a regular module:

'_______________________________________
Sub AutoExec()

MsgBox "AutoExec!!!!!"

End Sub
'_______________________________________

Create a new document before closing Word.
Then Close Word and start it again.

If you want to workaround your problem, put all your code in a regular
module and use something like I did above, but replace the MsgBox line by a
call to your sub in the regular module.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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