How to launch a URL in a existing session of IE? 
Author Message
 How to launch a URL in a existing session of IE?

I want to launch a specific URL from an external application, but I want it
to open in the following manner...
1.) If no session of IE is running, then open up a new browser window and
browse to the URL.
2.) If IE is already running, then somehow send a message to IE to browse to
the new URL.  I don't want to open another window.

If you have any ideas or examples, please post it up and let me know.

Philip



Sat, 24 May 2003 03:00:00 GMT  
 How to launch a URL in a existing session of IE?
Philip,

For the first one:
     you could instantiate an IE window by using the
    Set oIE = CreateObject(InternetExplorer.Application)
    oIE.navigate "http....."

For the second:
    Instead of creating the object, since it is already open you can just
reference the object directly.
    Could try: Set oIE = GetObject(InternetExplorer.Application)
    oIE.navigate "http..."

Mark

Quote:

> I want to launch a specific URL from an external application, but I want
it
> to open in the following manner...
> 1.) If no session of IE is running, then open up a new browser window and
> browse to the URL.
> 2.) If IE is already running, then somehow send a message to IE to browse
to
> the new URL.  I don't want to open another window.

> If you have any ideas or examples, please post it up and let me know.

> Philip



Sat, 24 May 2003 03:00:00 GMT  
 How to launch a URL in a existing session of IE?

(note: Active Desktop is required)...

'===
'ShellWindows.Item method describes better what you get when
'you enumerate the shell.windows collectiom.  
'
'the docs for ShellWindows._NewEnum look to me to be in error.
'===
myurl = "http://msdn.microsoft.com/library/" _
& "psdk/shellcc/shell/objects/shellwindows/item.htm"
with createobject("shell.application")
  set iewindow = nothing
  for each owin in .windows
    if lcase(typename(owin.document)) = "htmldocument" then
      set iewindow = owin
    end if
  next
end with

if iewindow is nothing then
  with createobject("internetexplorer.application")
    .navigate myurl
    .visible = 1
  end with
else
  iewindow.navigate myurl
end if

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--

Quote:

> I want to launch a specific URL from an external application, but I want it
> to open in the following manner...
> 1.) If no session of IE is running, then open up a new browser window and
> browse to the URL.
> 2.) If IE is already running, then somehow send a message to IE to browse to
> the new URL.  I don't want to open another window.

> If you have any ideas or examples, please post it up and let me know.

> Philip



Sat, 24 May 2003 03:00:00 GMT  
 How to launch a URL in a existing session of IE?

By any chance do you know how to do the same thing for Netscape?

Philip


Quote:
> (note: Active Desktop is required)...

> '===
> 'ShellWindows.Item method describes better what you get when
> 'you enumerate the shell.windows collectiom.
> '
> 'the docs for ShellWindows._NewEnum look to me to be in error.
> '===
> myurl = "http://msdn.microsoft.com/library/" _
> & "psdk/shellcc/shell/objects/shellwindows/item.htm"
> with createobject("shell.application")
>   set iewindow = nothing
>   for each owin in .windows
>     if lcase(typename(owin.document)) = "htmldocument" then
>       set iewindow = owin
>     end if
>   next
> end with

> if iewindow is nothing then
>   with createobject("internetexplorer.application")
>     .navigate myurl
>     .visible = 1
>   end with
> else
>   iewindow.navigate myurl
> end if

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

> Please do not email questions - post them to the newsgroup instead.
> --




- Show quoted text -

Quote:
> > I want to launch a specific URL from an external application, but I want
it
> > to open in the following manner...
> > 1.) If no session of IE is running, then open up a new browser window
and
> > browse to the URL.
> > 2.) If IE is already running, then somehow send a message to IE to
browse to
> > the new URL.  I don't want to open another window.

> > If you have any ideas or examples, please post it up and let me know.

> > Philip



Sun, 01 Jun 2003 07:58:12 GMT  
 How to launch a URL in a existing session of IE?
You're kidding, right???

I heard rumors a long time ago that NS6 was supposed to expose an externally
scriptable object model, but I have no idea if that ever really happened or
even if my recollection is anywhere near being correct at all.  Even if it
did, it wouldn't be in the Shell.Application's Windows collection.

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--

Quote:

> By any chance do you know how to do the same thing for Netscape?

> Philip



> > (note: Active Desktop is required)...

> > '===
> > 'ShellWindows.Item method describes better what you get when
> > 'you enumerate the shell.windows collectiom.
> > '
> > 'the docs for ShellWindows._NewEnum look to me to be in error.
> > '===
> > myurl = "http://msdn.microsoft.com/library/" _
> > & "psdk/shellcc/shell/objects/shellwindows/item.htm"
> > with createobject("shell.application")
> >   set iewindow = nothing
> >   for each owin in .windows
> >     if lcase(typename(owin.document)) = "htmldocument" then
> >       set iewindow = owin
> >     end if
> >   next
> > end with

> > if iewindow is nothing then
> >   with createobject("internetexplorer.application")
> >     .navigate myurl
> >     .visible = 1
> >   end with
> > else
> >   iewindow.navigate myurl
> > end if

> > --
> > Michael Harris
> > Microsoft.MVP.Scripting
> > --

> > Please do not email questions - post them to the newsgroup instead.
> > --



> > > I want to launch a specific URL from an external application, but I
want
> it
> > > to open in the following manner...
> > > 1.) If no session of IE is running, then open up a new browser window
> and
> > > browse to the URL.
> > > 2.) If IE is already running, then somehow send a message to IE to
> browse to
> > > the new URL.  I don't want to open another window.

> > > If you have any ideas or examples, please post it up and let me know.

> > > Philip



Sun, 01 Jun 2003 13:07:22 GMT  
 How to launch a URL in a existing session of IE?
It was just a stab in the dark.  Thanks anyways...

Philip


Quote:
> You're kidding, right???

> I heard rumors a long time ago that NS6 was supposed to expose an
externally
> scriptable object model, but I have no idea if that ever really happened
or
> even if my recollection is anywhere near being correct at all.  Even if it
> did, it wouldn't be in the Shell.Application's Windows collection.

> --
> Michael Harris
> Microsoft.MVP.Scripting
> --

> Please do not email questions - post them to the newsgroup instead.
> --




- Show quoted text -

Quote:
> > By any chance do you know how to do the same thing for Netscape?

> > Philip



> > > (note: Active Desktop is required)...

> > > '===
> > > 'ShellWindows.Item method describes better what you get when
> > > 'you enumerate the shell.windows collectiom.
> > > '
> > > 'the docs for ShellWindows._NewEnum look to me to be in error.
> > > '===
> > > myurl = "http://msdn.microsoft.com/library/" _
> > > & "psdk/shellcc/shell/objects/shellwindows/item.htm"
> > > with createobject("shell.application")
> > >   set iewindow = nothing
> > >   for each owin in .windows
> > >     if lcase(typename(owin.document)) = "htmldocument" then
> > >       set iewindow = owin
> > >     end if
> > >   next
> > > end with

> > > if iewindow is nothing then
> > >   with createobject("internetexplorer.application")
> > >     .navigate myurl
> > >     .visible = 1
> > >   end with
> > > else
> > >   iewindow.navigate myurl
> > > end if

> > > --
> > > Michael Harris
> > > Microsoft.MVP.Scripting
> > > --

> > > Please do not email questions - post them to the newsgroup instead.
> > > --



> > > > I want to launch a specific URL from an external application, but I
> want
> > it
> > > > to open in the following manner...
> > > > 1.) If no session of IE is running, then open up a new browser
window
> > and
> > > > browse to the URL.
> > > > 2.) If IE is already running, then somehow send a message to IE to
> > browse to
> > > > the new URL.  I don't want to open another window.

> > > > If you have any ideas or examples, please post it up and let me
know.

> > > > Philip



Sun, 01 Jun 2003 23:32:08 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Launching URL from existing instance of Internet Explorer

2. Launching URL/IE from button

3. Script to push a URL from Excel to IE in current session

4. Launching vb app when IE launch

5. Launch IE or Grab IE Instance

6. Launch Excel & open existing WB

7. Launch URL within browser window using TargetFrameName?

8. can I use command line to launch internet explorer and open one url each time

9. can I use command line to launch internet explorer and open one url each time

10. can I use command line to launch internet explorer and open one url each time

11. launch URL

12. can I use command line to launch internet explorer and open one url each time

 

 
Powered by phpBB® Forum Software