Jump to content

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


Recommended Posts

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

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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

Link to comment
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 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...