Controling Internet Explorer? - basic.visual
This is a discussion on Controling Internet Explorer? - basic.visual ; I'm a still new to visual basic, and I've hit a problem
I can't find a workaround for.
I'm attempting to open and close an Internet Explorer window
using visual basic 6. I've got the open working properly,
but for ...
-
Controling Internet Explorer?
I'm a still new to visual basic, and I've hit a problem
I can't find a workaround for.
I'm attempting to open and close an Internet Explorer window
using visual basic 6. I've got the open working properly,
but for some reason, I can't close the browser when I'm finished with
it.
Here's the code I'm using for opening and closing
=====================================================
'setup for web popups
Dim oIE
Set oIE = CreateObject("InternetExplorer.Application")
' Open a URL upon command %
If Left$(CurrentCommandString, 1) = "%" Then
oIE.Visible = True
oIE.navigate Mid$(CurrentCommandString, 2, T - 2)
' Close the Internet Explorer window upon command
ElseIf Left$(CurrentCommandString, 2) = "@%" Then
oIE.Quit
oIE.Visible = False
Endif
======================================================
I've tried oIE.Quit, oIE.Visible=False nothing works,
unless I place the commands right after the open routine.
Can anyone assist?
Jeff
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
-
Re: Controling Internet Explorer?
IE.Quit works in script. Maybe you're calling it
before the instance is fully instantiated?
Two thoughts:
1) Don't create an IE instance until you know
that you'll need it. That's a lot of work going on
behind the scenes only to dump it if your string
isn't valid.
2) Use a WebBrowser control on a form instead
of creating IE. A WB is actually an IE window and
uses the IE object methods, but you've got better
control of it. (Get a WB into your toolbox by setting
a reference to "Microsoft Internet Controls".
--
_____________________________
mayayXXana1a@mindYYspring.com
For return email remove XX and YY.
_____________________________
Oldbitcollector <oldbitcollector@mytrashmail.com> wrote in message
news:MPG.1c8418acf8eae2f79896a9@news.zoominternet.net...
> I'm a still new to visual basic, and I've hit a problem
> I can't find a workaround for.
>
> I'm attempting to open and close an Internet Explorer window
> using visual basic 6. I've got the open working properly,
> but for some reason, I can't close the browser when I'm finished with
> it.
>
> Here's the code I'm using for opening and closing
> =====================================================
>
> 'setup for web popups
> Dim oIE
> Set oIE = CreateObject("InternetExplorer.Application")
>
> ' Open a URL upon command %
> If Left$(CurrentCommandString, 1) = "%" Then
> oIE.Visible = True
> oIE.navigate Mid$(CurrentCommandString, 2, T - 2)
>
> ' Close the Internet Explorer window upon command
> ElseIf Left$(CurrentCommandString, 2) = "@%" Then
> oIE.Quit
> oIE.Visible = False
>
> Endif
> ======================================================
>
> I've tried oIE.Quit, oIE.Visible=False nothing works,
> unless I place the commands right after the open routine.
>
> Can anyone assist?
>
> Jeff
>
> ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet
News==----
> http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+
Newsgroups
> ----= East and West-Coast Server Farms - Total Privacy via Encryption
=----
-
Re: Controling Internet Explorer?
Hello,
try to use
Dim WithEvents oIE As InternetExplorer
instead of the simple Dim
Greetings
Achim Reichel, Gernany
Similar Threads
-
By Application Development in forum Sharepoint
Replies: 0
Last Post: 10-03-2007, 09:50 AM
-
By Application Development in forum Inetserver
Replies: 0
Last Post: 11-07-2003, 03:32 AM
-
By Application Development in forum Microsoft Exchange
Replies: 0
Last Post: 10-05-2003, 08:11 AM
-
By Application Development in forum XML SOAP
Replies: 0
Last Post: 10-05-2003, 04:22 AM