Sign in to follow this  
Followers 0
GPaul

_IECreate Troubles with Intranet sites

7 posts in this topic

I am trying to make a script to open two Intranet sites in tabs in one IE window and then maximize the window.  I'm using the following code.

#include <IE.au3>

$oIE = _IECreate("intranetsite1")
__IENavigate($oIE, "intranetsite2", 0, 0x800)
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_MAXIMIZE)
_IEAction($oIE, "visible")
_IELoadWait($oIE)

When I run the script IE opens and goes to the first page but then nothing else happens.

If I modify the code so the _IECreate points to an internet site it then also opens a second tab with the second site and then maximizes as expected.

I see this behavior no matter what intranet site I put in the _IECreate line.

Is there a way to get this to work with intranet sites?

Thanks

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

I tried the code and inserted in 2 of my intranet pages and it worked just fine.  I even tried the short name (http://servername ) and the fully qualified name (http://servername.domain.org) and both worked.

Edited by MuffinMan

Share this post


Link to post
Share on other sites

Are you using a modified _IENavigate? As, that function should only take 3 parameters.


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

I'm using __IENavigate instead of _IENavigate to make it open in a new tab instead of the same tab.

It really appears this has something to do with the site in _IECreate being seen as an Intranet site by IE.  If I rem out the __IENavigate line the window does not maximize with an Intranet site in _IECreate, but does with an Internet site, such as www.google.com.  However if I then put www.google.com in the Intranet Zone in IE it no longer maximizes.

Share this post


Link to post
Share on other sites

Try using ShellExecute then, just have a look at the 5th example for 

_IECreate

and see if that does what you would like. :)


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

Share this post


Link to post
Share on other sites

So I figureed out if I wait a few seconds after the _IECreate and then use _IEAttach to attach to the window that was just opened everything else works fine.  Thanks for the help, it got me thinking about delays.  I'll post my final code just incase anybody is interested.

#include <IE.au3>

$oIE = _IECreate("intranet1")
sleep(3000)
$oIE = _IEAttach("intranet1")
__IENavigate($oIE, "intranet2", 0,0x800)
$HWND = _IEPropertyGet($oIE, "hwnd")
WinSetState($HWND, "", @SW_MAXIMIZE)
_IEAction($oIE, "visible")

Share this post


Link to post
Share on other sites

Glad you found a solution to your needs. :)


Snips & Scripts


My Snips: graphCPUTemp ~ getENVvars
My Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4

Feel free to use any of my code for your own use.                                                                                                                                                           Forum FAQ

 

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