Jump to content

Open a dowloaded file automatically in Internet Explorer - (Moved)


TracyC
 Share

Recommended Posts

Hello!

I found this piece of code on the forum, and it supposedly worked to bypass that pesky download window in IE.  Basically I want to mimic the "alaways download the file" option that IE took away from us.  Currently, when I download a Word file on IE, I get a popup box where I am forced to click 'Open."  

 var winHandle = AutoItX.WinGetHandle("[Class:IEFrame]");
            var ctrlHandle = AutoItX.ControlGetHandle(winHandle, "[Class:DirectUIHWND]");
            var ctrlPos = AutoItX.ControlGetPos(winHandle, ctrlHandle);
            AutoItX.WinActivate(winHandle);
            AutoItX.ControlClick(winHandle, ctrlHandle, "primary", 1, ctrlPos.Width - 160, ctrlPos.Height - 30);
            Thread.Sleep(1000);
            AutoItX.ControlSend(winHandle, ctrlHandle, "{ENTER}");

 

I am getting an error when I run it that says:

Varwinhadle=AtoITX.wingethandle["[Class:IEFrame]"] ^ ERROR

 

Can anyone help me fix it?

Link to comment
Share on other sites

  • Moderators

Moved to the appropriate forum, as the Developer General Discussion forum very clearly states:

Quote

General development and scripting discussions.


Do not create AutoIt-related topics here, use the AutoIt General Help and Support or AutoIt Technical Discussion forums.

Moderation Team

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

There are multiples issues in the code you provided.  Please refer to AutoItX.chm help file located in AutoItX folder.

As described in help file, you cannot use handles in Win* methods nor in Control* methods.  You can use Text special definition though.

Third parameter of Control* methods has also some limitations.  Be careful to check what they are.

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