Sign in to follow this  
Followers 0
tv69

MS Word doc open with Autoit does not allow MS Mailings to connect to data in Excel file

4 posts in this topic

Hello everyone,

I'm new to the world of Autoit and I'm finding code examples for what I'm trying to do.

I'm using the following code I found online to open a word document.

#include <word.au3>
$oWord = _Word_Create()
Global $sDoc = "....path...docx"
$oDoc = _Word_DocOpen($oWord, $sDoc)
ConsoleWrite(@error & @LF)

It works just fine to open the document however the document uses MS Word Mailings to fetch information from an Excel file.  Using this script does not bring up the pop up when the MS Word file is opened which tries to connect to the data in the Excel file by running an SQL command which you are asked yes or no to run.

I tried to attach a jpg of the popup but had a hard time finding how.

Can someone please be so kind as to give me a bit of help?

Thank you,

TV

Share this post


Link to post
Share on other sites



What's the value of property DisplayAlerts aftert the document has been opened?

MsgBox(0, "", $oWord.DisplayAlerts)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Hi water,

I added your line of code and it returned "0" in the msgbox.  I suppose DisplayAlerts needs to be turned on?  How would that be done?

Thanks for your help.

TV

Share this post


Link to post
Share on other sites

Unfortunately I have never used MS Word Mailing.

Seems we need to tell Word to not supress messages. I will investigate when I return to my office (end of the week).


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0