Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2007

Tip: Looking for answers? Try searching our database.

Autoexec and Word sessions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
eric - 13 Nov 2006 08:24 GMT
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
Doug Robbins - Word MVP - 14 Nov 2006 06:14 GMT
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.

Signature

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

> Hi!
>
[quoted text clipped - 8 lines]
>
> /e
pelphreyj - 27 Feb 2007 19:12 GMT
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.

> 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:
[quoted text clipped - 18 lines]
> >
> > /e
Shauna Kelly - 27 Feb 2007 22:21 GMT
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

> Doug,
> I am having the exact problem which you describe below.  I have created a
[quoted text clipped - 40 lines]
>> >
>> > /e
jurgen.brandle@swisslog.com - 03 Jan 2007 15:22 GMT
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

eric schrieb:

> Hi!
>
[quoted text clipped - 8 lines]
>
> /e
Donald A. Herman - 26 Jan 2007 11:20 GMT
I think your problem maybe "Tools>Macros>Security"

Signature

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

eric schrieb:

> Hi!
>
[quoted text clipped - 11 lines]
>
> /e
Perry - 26 Jan 2007 16:43 GMT
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

"XP" <XP@discussions.microsoft.com> schreef in bericht
news:070D96F5-FD62-435F-9134-A87ED1C70195@microsoft.com...
> Hi Perry,
>
[quoted text clipped - 46 lines]
>> >
>> > Thanks much in advance.

>I think your problem maybe "Tools>Macros>Security"
>
[quoted text clipped - 36 lines]
>>
>> /e
Perry - 26 Jan 2007 16:46 GMT
Dam*ed
Pls disregard.
Wright message: wrong newsgroup.

Perry

> The only thing that I think of:
> Mainform/subform - LinkChild-/LinkMasterFields relation is broke.
[quoted text clipped - 102 lines]
>>>
>>> /e
Donald A. Herman - 29 Jan 2007 06:18 GMT
Whew, After reading your response, I had to back and read the original post,
to see what the heck I was responding to.
LOL

Signature

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

> Dam*ed
> Pls disregard.
[quoted text clipped - 108 lines]
>>>>
>>>> /e
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.