InternetExplorer.Offline Has No Effect

  • Thread starter Thread starter aron bock
  • Start date Start date
A

aron bock

Hello, I want to programmatically set IE to work offline. As far as I can
tell I should be able to set the "Offline" property of the InternetExplorer
automation object to achieve that ... but in repeated tests setting that
property seems to have no effect: the "File/Work Offline" menuitem is not
checked, and IE continues to be able to browse online.

If somebody could suggest how I may achieve this (or even point out whether
I'm in the wrong forum) I'd much appreciate it!

Regards,

--A
 
aron bock said:
Hello, I want to programmatically set IE to work offline. As far as I can
tell I should be able to set the "Offline" property of the InternetExplorer
automation object to achieve that ... but in repeated tests setting that
property seems to have no effect: the "File/Work Offline" menuitem is not
checked, and IE continues to be able to browse online.

If somebody could suggest how I may achieve this (or even point out whether
I'm in the wrong forum) I'd much appreciate it!

When are you setting it? It's possible that some other program is unsetting it.
Third-party Internet apps seem prone to doing it repeatedly, for example.

Use RegMon (freeware from SysInternals) to monitor use of GlobalUserOffline,
first to see if your program is setting it and secondly to see if some other program
is later unsetting it.

BTW there used to be a nice freeware SysTray tool called InkSwitch
(designed especially for Dial-up users but still partially usable by broadband users)
You may find it an adequate alternative to what you are trying to do.

Regards,

--A


HTH

Robert Aldwinckle
---
 
In addition to what Robert said:

You may need to use the WinInet API functions to programmatically set the
Offline mode.

Supporting Offline Browsing in Applications and Components
http://msdn.microsoft.com/library/default.asp?url=/workshop/components/offline/offline.asp

See also:
http://www.google.com/search?q=VB+InternetSetOption&btnG=Google+Search

--
Ramesh, MS-MVP
Windows Shell/User

Windows XP Troubleshooting
http://www.winhelponline.com

Windows XP Newsgroup Setup Instructions for Outlook Express:
http://www.microsoft.com/windowsxp/expertzone/newsgroupsetup.mspx
 
Robert,

I've tried setting it at variously. The property itself is getting set to
true/false, whatever, but the setting seems to have no effect. For example,
as in the following VBA code:

Dim oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
oIE.Offline = True

At this point I can still browse online. What's more, the File/"Work
Offline" menuitem is unchecked.

However, things work as expected if I manually check/uncheck the menuitem
above. Thus leading me to think the Offline property on the IE automation
object may be defunct.

--A
 
Ramesh,

As I mentioned in my followup to the previous respondent ... if I manually
check/uncheck the File/Work Offline... menuitem, things work as advertised.
I'm just unable to set this property using the IE automation object's
Offline property. I did try the set-WinInet-offline business, but was
unsuccessful at getting that to work.

--A
 
aron bock said:
Robert,

I've tried setting it at variously. The property itself is getting set to
true/false, whatever, but the setting seems to have no effect. For example,
as in the following VBA code:

Dim oIE = CreateObject("InternetExplorer.Application")
oIE.Visible = True
oIE.Offline = True

At this point I can still browse online. What's more, the File/"Work
Offline" menuitem is unchecked.

However, things work as expected if I manually check/uncheck the menuitem
above. Thus leading me to think the Offline property on the IE automation
object may be defunct.


The documentation doesn't really promise that GlobalUserOffline
will be affected, just that your object will act as if it is:

http://msdn.microsoft.com/workshop/browser/webbrowser/reference/properties/offline.asp

<quote>
Sets or retrieves a Boolean value that indicates whether the object
is currently operating in offline mode.
</quote>


BTW I don't know. That would be my interpretation of what is there.

You may get more informed ideas from a newsgroup which
specializes in scripting or web development, etc.
Use the MSDN Home page and its Community links to newsgroups.
Unfortunately I have never used them so I don't know how active they are.


Good luck

Robert
---
 
Robert, thank you for your input and, yes, I've seen that page. It also
says " In offline mode, the browser is forced to read HTML pages from the
local cache rather than from the source document. " Which means that once I
set the browser to be offline, at least that instance of the browser should
no longer [be able to] go online. As I mentioned before I find that not to
be the case.

--A
 
Back
Top