Jump to content
Sign in to follow this  
hunt

Can't to toggle IE offline mode

Recommended Posts

hunt

Hello. I have a problem. I can't to change state of IE offline mode.

In example, if to enable manually offline mode and to execute this code

$oIE = _IECreate("http://google.com")
_IEPropertySet($oIE, "offline", False)

then the offline mode does not change state.

How to solve this problem? I tested this on IE6 and IE8.

Edited by hunt

Share this post


Link to post
Share on other sites
water

You need to do some error checking!

Most of the functions give you a return value and set the macros @error and @extended to let you know what problem occurred.

Return Value
Success:  Returns 1
Failure:  Returns 0 and sets @ERROR
@Error:  0 ($_IEStatus_Success) = No Error
3 ($_IEStatus_InvalidDataType) = Invalid Data Type
4 ($_IEStatus_InvalidObjectType) = Invalid Object Type
5 ($_IEStatus_InvalidValue) = Invalid Value
@Extended:  Contains invalid parameter number

So please change your code like this:

$oIE = _IECreate("http://google.com")
$iResult = _IEPropertySet($oIE, "offline", False)
ConsoleWrite("Return Value: " & $iResult & ", @error : " & @error & ", @extended: " & @extended)
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
hunt

Return Value: 1, @error : 0, @extended: 0

it seems there's only one way to solve this problem - to write value 0 in HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionInternet SettingsGlobalUserOffline Edited by hunt

Share this post


Link to post
Share on other sites
water

Writing data to the registry is easy with AutoIt so I would try this.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
hunt

other way does not exist?

Share this post


Link to post
Share on other sites
water

I think this explains why _IEPropertySet doesn't work.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
hunt

Ok thx.

Share this post


Link to post
Share on other sites
water

If you got your script working could you please post the result for future reference?

Thanks


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
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  

×