AutoOpen macro won't run

M

Mark B

I have an Access database with links to Word Documents.
When you double-click a document, it opens in Word and I
plan to have a macro execute when the document opens.
I've named the macro AutoOpen and included it
in "Normal.dot" - but it doesn't run. I know it is
supposed to run if the file is opened via "File - Open"
or you open it as one of your "recent documents". Is
there any way to execute the AutoOpen when the file is
activated automatically from an Access form?

Thanks for the help.

Mark
 
H

Harold Kless[MSFT}

Hi Mark,
The AutoOpen should run even when automating from Access.
You could explicitly call the code using Application.run from the Access
code or
another alternative is not use AutoOpen but use a class module.
In the class module from within Word or Access you can declare a variable
Word application Withevents which will enable the Document Open event. So
now, when the class is instantiated whenever a document is opened it will
fire the event and this run your code.


Harold Kless, MCSD
Support Professional
Microsoft Technical Support for Business Applications
(e-mail address removed)

--


This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
 

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