PDA

Click to See Complete Forum and Search --> : ------------ How to navigate ? ------------


Keiko
Nov 24th, 1999, 03:09 PM
Hi there,

Currently I'm doing a testing on VB5's user document to develop web application.

My question is how to navigate from one UserDocument to another UserDocument on different session of browser.

For instance, currently I just have one browser up and I've opened "a.vbd". Now I want to call "b.vbd", I can use:

UserDocument.Hyperlink.NavigateTo "b.vbd"

It will call "b.vbd" on the same session of browser.

How to open "b.vbd" on different session of browser (I want to have 2 browsers up, one is for "a.vbd" and the other is for "b.vbd").

I'm using IE3.x - IE4.x and Netscape 4.x

Thank you.

Keiko
Nov 25th, 1999, 07:17 AM
Chris,

Since web application will be accessed by many users with many different platforms and browsers, is there any other way to do it ?
Because the pathing is not fixed also.

Anyway thank you for your reply, I will try this if there is no any other way.

Thank you.

Compwiz
Nov 25th, 1999, 08:31 AM
The following code just simply opens the default browser (if not already opened) and navigates to a site.

Module Code:

Option Explicit
Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Sub ShellToBrowser(Frm As Form, ByVal URL As String, ByVal WindowStyle As Integer)
Dim API As Long
API = ShellExecute(Frm.hwnd, "open", URL$, "", App.Path, WindowStyle%)
'Check return value
If API < 31 Then
'error code - see api help for more info
MsgBox App.Title & " had a problem running your web browser. You should check that your browser is correctly installed. (Error" & Format$(API) & ")", 48, "Browser Unavailable"
ElseIf API = 32 Then
'no file association
MsgBox App.Title & " could not find a file association for " & URL & " on your system. You should check that your browser is correctly installed and associated with this type of file.", 48, "Browser Unavailable"
End If
End Sub
Public Sub LaunchSite(Form As Form, Site As String)
Call ShellToBrowser(Form, Site, 0)
End Sub


Form Code

Private Sub Command1_Click()
LaunchSite Me, "http://www.vb-world.net"
End Sub


Obvioulsy, the site doesn't have to be VB-World (http://www.vb-world.net) and doesn't have to be under Command1, but you get the idea.

------------------
Tom Young, 14 Year Old
tyoung@stny.rr.com
ICQ: 15743470 (http://wwp.icq.com/15743470) Add Me (http://wwp.icq.com/scripts/search.dll?to=15743470) ICQ Me (http://wwp.icq.com/scripts/contact.dll?msgto=15743470)
AIM: TomY10 (http://www.aol.com/aim/aim30.html)
PERL, JavaScript and VB Programmer

Keiko
Nov 25th, 1999, 09:45 AM
Thanks Compwiz, I'll try your code.

chrisfricke
Nov 25th, 1999, 11:00 AM
You could try opening a new version of the browser with the shell command and place the path to the file in the first switch eg

Call Shell "c:\program Files\internet explorer\iexplore.exe <A HREF="http://www.vb-world.net"" TARGET=_blank>http://www.vb-world.net"</A>

This should work OK

Chris

chrisfricke
Nov 25th, 1999, 11:00 AM
You could try opening a new version of the browser with the shell command and place the path to the file in the first switch eg

Call Shell "c:\program Files\internet explorer\iexplore.exe <A HREF="http://www.vb-world.net"" TARGET=_blank>http://www.vb-world.net"</A>

This should work OK

Chris