Autoexec and Word sessions

E

eric

Hi!

I have some code that runs in an autoexec macro (in a global template). It
runs fine, but it seems that if the user happens to open a new Word session
(ie has Word already running and opens Word again instead of a new
document), autoexec doesn't fire? And it doesn't matter if it's in a global
template or in normal.dot?

Is that true and any work arounds? (ie u really want to fire some code every
time word starts).

/e
 
D

Doug Robbins - Word MVP

There are others who discount this, but I am aware of some instances where
an autoexec macro in a global template did not run when Word:

1. Was the editor in Outlook and Outlook was started before Word,

2. Word was started by double clicking on a document either on the
desktop or in Windows Explorer.

Word had to be started from the Start menu to get it to work properly.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

jurgen.brandle

Hi eric

I have most probably a similar problem: I got a template in the word
startup-folder. In general, the autoexec macro runs fine, but on some
PC's (out of approx 300) there are problems. The template is read, but
the macro does not start or does not execute as planned. My questions:
1. when your macro is not executed, is at least the template read?
2. where is the templated stored?

My present work-around:
code in autoexec:
Application.OnTime When:=Now + TimeValue("00:00:03"), _
Name:="start_macro"

The start_macro contains the actual code.

regards

Jürgen
 
D

Donald A. Herman

I think your problem maybe "Tools>Macros>Security"

--
Donald A. Herman
Software - Scheduler Pro, Disk Cataloger, Math Wizard
http://don_herman.tripod.com
Office Extras, Addins
http://don_herman.tripod.com/msoextras
..
..
Hi eric

I have most probably a similar problem: I got a template in the word
startup-folder. In general, the autoexec macro runs fine, but on some
PC's (out of approx 300) there are problems. The template is read, but
the macro does not start or does not execute as planned. My questions:
1. when your macro is not executed, is at least the template read?
2. where is the templated stored?

My present work-around:
code in autoexec:
Application.OnTime When:=Now + TimeValue("00:00:03"), _
Name:="start_macro"

The start_macro contains the actual code.

regards

Jürgen
 
P

Perry

The only thing that I think of:
Mainform/subform - LinkChild-/LinkMasterFields relation is broke.

If you rebind yr subform using another recordsource, are the fields
available for mainform/subform (LinkChild- and LinkMaster flds)
in the new recordsource?

If not, you will also have to re-assign these settings when rebinding yr
subform.

Krgrds,
Perry
 
P

pelphreyj

Doug,
I am having the exact problem which you describe below. I have created a
global addin that starts when Word (2003) is opened, which generates a custom
menu bar. This menu bar includes shortcuts to all of our company's
correspondence documents. I would like to place this addin in each
co-worker's start-up folder so when they begin Word, the menu bar will
automatically generate. However, our company uses Outlook as its e-mail
manager, and most everyone opens this application when they first log on in
the morning. Then when Word is fired up, it sees that the addin is already
open in Outlook, and does not trigger the Autoexec action. Is there any way
around this?? I do not want to close Outlook each time Word is opened, nor
do I want to run the macro manually within Word. I tried the other
suggestions from this post already, and nothing has worked so far.
 
S

Shauna Kelly

Hi

One way to do this may be to trap Word events such as DocumentOpen or
DocumentChange as shown at
Writing application event procedures
http://www.word.mvps.org/FAQs/MacrosVBA/AppClassEvents.htm

You can then work out whether the user is in Outlook or Word, and respond
accordingly. There are several ways to detect whether the user is in Word or
Outlook, but one easy way is to investigate the presence or absence of the
document's Email object.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 

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