Home All Groups Group Topic Archive Search About
Author
24 Nov 2006 12:06 AM
James L Szatkowski, PE
I'm using (successfully in VB Express) this routine:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

Call Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE
http://www.microsoft.com", AppWinStyle.MinimizedNoFocus, True)

Call Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE
http://www.yahoo.com",
AppWinStyle.MinimizedNoFocus, True)

Call Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE
http://www.google.com",
AppWinStyle.MinimizedNoFocus, True)

End Sub

However, I'd like to

1) input an array of  URL's and sequence through the URL's one at at time.

Right now this routine opens the first and stops until I close it, then
opens the second waiting again until I close it and then opens the third
window (instance) of IE.

I really want it

2)  to load the first URL completely, then open the second URL in the same
window in place of the 1st, then 2nd URL, etc.).

Gotta be something simple... I just don't see an example anywhere



Thanks!
Jim

Author
24 Nov 2006 5:39 AM
Cor Ligthert [MVP]
James,

I don't know if it helps your problem, but you more nice you can use the
application.Start for this.

There is a sample for that on this page
http://www.vb-tips.com/dbpages.aspx?ID=7ecd7359-0114-43bb-8f3a-14d6b93856e8

Cor


Show quoteHide quote
"James L Szatkowski, PE" <james***@inovion.com> schreef in bericht
news:%23fTdlx1DHHA.3212@TK2MSFTNGP04.phx.gbl...
> I'm using (successfully in VB Express) this routine:
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>
> Call Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE
> http://www.microsoft.com", AppWinStyle.MinimizedNoFocus, True)
>
> Call Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE
> http://www.yahoo.com",
> AppWinStyle.MinimizedNoFocus, True)
>
> Call Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE
> http://www.google.com",
> AppWinStyle.MinimizedNoFocus, True)
>
> End Sub
>
> However, I'd like to
>
> 1) input an array of  URL's and sequence through the URL's one at at time.
>
> Right now this routine opens the first and stops until I close it, then
> opens the second waiting again until I close it and then opens the third
> window (instance) of IE.
>
> I really want it
>
> 2)  to load the first URL completely, then open the second URL in the same
> window in place of the 1st, then 2nd URL, etc.).
>
> Gotta be something simple... I just don't see an example anywhere
>
>
>
> Thanks!
> Jim
>
>
Author
24 Nov 2006 6:40 AM
Branco Medeiros
James L Szatkowski, PE wrote:
Show quoteHide quote
> I'm using (successfully in VB Express) this routine:
> Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
> System.EventArgs) Handles Button1.Click
>
> Call Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE
> http://www.microsoft.com", AppWinStyle.MinimizedNoFocus, True)
>
> Call Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE
> http://www.yahoo.com",
> AppWinStyle.MinimizedNoFocus, True)
>
> Call Shell("C:\Program Files\Internet Explorer\IEXPLORE.EXE
> http://www.google.com",
> AppWinStyle.MinimizedNoFocus, True)
>
> End Sub
>
> However, I'd like to
>
> 1) input an array of  URL's and sequence through the URL's one at at time.
>
> Right now this routine opens the first and stops until I close it, then
> opens the second waiting again until I close it and then opens the third
> window (instance) of IE.
>
> I really want it
>
> 2)  to load the first URL completely, then open the second URL in the same
> window in place of the 1st, then 2nd URL, etc.).
<snip>

I'm affraid you'll have to give up the (apparent) simplicity of your
approach and consider dealing with InternetExplorer the COM object,
exposed by the Microsoft Internet Controls COM library (shdocvw.dll).

Something in the ways of:

  <aircode>
  Private WithEvents IE As SHDocVw.InternetExplorer
  Private mPageIndex As Integer
  Private mPages() As String = { _
  Private Sub NextPage()
  'Navigates to page pointed by mPages(mPageIndex) and then increments
  'mPageIndex

    If mPageIndex < 0 OrElse mPageIndex >= mPages.Length Then Return
    Dim URL As String = mPages(mPageIndex)
    mPageIndex += 1

    If IE Is Nothing Then IE = New SHDocVw.InternetExplorer
    IE.Visible = True
    IE.Navigate2(URL)
  End Sub

  Private Sub IE_DocumentComplete(...) _
  Handles IE.DocumentComplete
  'When the pages finishes showing, move on to the next page
  '(Yikes!)
    NextPage()
  End Sub
  </aircode>

HTH.

Regards,

Branco.