Jump to content

Clicking Yes on a dialog box...


Recommended Posts

This is my first attempt at writing a script in AutoIT, so please excuse any silly gaffes or questions that I have...

I need to run an autoemailing database every night at 3 a.m. The scheduled task will open the database, the database generates the reports and emails 'em out. No problems - until I get to the email. Outlook forces me to click "Yes" to a dialog box that pops up asking me if I'm sure that I want to send the email. I have to wait 5 seconds after the dialog box appears to click Yes. Below is the code that I wrote to try and accomplish this task automatically...But I get an "Unable to parse" error...

I've triple checked the documentation and can't see anything wrong with this - I know I still need to add the "Wait 5 seconds", but I wanted to try this out first......Any ideas? I need to have this running by Tuesday, and it's not looking promising. Really appreciate any and all assistance.

Chris

CODE
ControlSend ("Microsoft Office Outlook", "A program is trying to automatically send e-mail on your behalf."&Chr(13)&"Do you want to allow this?"&Chr(13)&Chr(13)&"If this is unexpected, it may be a virus and you should choose ""No"".",1,{Left}{Enter})
Link to comment
Share on other sites

This is my first attempt at writing a script in AutoIT, so please excuse any silly gaffes or questions that I have...

I need to run an autoemailing database every night at 3 a.m. The scheduled task will open the database, the database generates the reports and emails 'em out. No problems - until I get to the email. Outlook forces me to click "Yes" to a dialog box that pops up asking me if I'm sure that I want to send the email. I have to wait 5 seconds after the dialog box appears to click Yes. Below is the code that I wrote to try and accomplish this task automatically...But I get an "Unable to parse" error...

I've triple checked the documentation and can't see anything wrong with this - I know I still need to add the "Wait 5 seconds", but I wanted to try this out first......Any ideas? I need to have this running by Tuesday, and it's not looking promising. Really appreciate any and all assistance.

Chris

Welcome to the forum. The problem is with your punctuation:

ControlSend ("Microsoft Office Outlook", "A program is trying to automatically send e-mail on your behalf." & @CR & _
             "Do you want to allow this?" & @CR & @CR & _
             'If this is unexpected, it may be a virus and you should choose "No".', 1, "{Tab}{Enter}")

However, I would suggest skipping Outlook altogether and sending directly to the SMTP server. Do a search here on the form for SMTP and you'll find several working pieces of code that allow you to send email without using Outlook.

Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

  • 1 year later...

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...