469,616 Members | 1,652 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,616 developers. It's quick & easy.

array and shell

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
Nov 23 '06 #1
2 2420
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?...a-14d6b93856e8

Cor
"James L Szatkowski, PE" <ja******@inovion.comschreef in bericht
news:%2****************@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


Nov 24 '06 #2

James L Szatkowski, PE wrote:
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 = { _
"www.google.com", "www.microsoft.com", "www.digg.com" _
}

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.

Nov 24 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Fireangel | last post: by
10 posts views Thread by dfetrow410 | last post: by
13 posts views Thread by David Golightly | last post: by
5 posts views Thread by bearophileHUGS | last post: by
reply views Thread by devrayhaan | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.