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 / September 2006

Tip: Looking for answers? Try searching our database.

AutoOpen not running

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TedMi - 19 Sep 2006 16:03 GMT
I need to open a doc from an Access form. Works fine, except the doc's
AutoOpen does not run. Here's the code:

Dim oWord as Object
Set oWord = GetObject("C:\Data\Merge1.doc")
oWord.Application.Visible = True

This creates a minimized instance of Word with the named doc open. The
prompt to enable/disable macros does appear, but the AutoOpen does not run.
It runs fine when opened from Word File Open or by double clicking its name.
The AutoOpen is in the doc, not normal.dot.

What the Auto does is reset merge data source to an Access file in the local
directory. Any suggestions?
Signature

Ted

Tony Jollans - 19 Sep 2006 17:21 GMT
Auto macros do not run when starting Word using Automation. You must
explicitly run them ..

   [Document_Ref].RunAutoMacro wdAutoOpen

--
Enjoy,
Tony

> I need to open a doc from an Access form. Works fine, except the doc's
> AutoOpen does not run. Here's the code:
[quoted text clipped - 12 lines]
> --
> Ted
TedMi - 19 Sep 2006 17:35 GMT
Thanks for the answer. Auto macros run SOMETIMES under Automation. I changed
my code to this, and AutoOpen runs!

Dim oWord as Object
Set oWord = CreateObject("Word.Application")
oWord.Visible = True
oWord.Documents.Open FileName:="C:\..."
Signature

Ted

> Auto macros do not run when starting Word using Automation. You must
> explicitly run them ..
[quoted text clipped - 24 lines]
> > --
> > Ted
 
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.