Results 1 to 6 of 6

Thread: ------------ How to navigate ? ------------

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229

    Post

    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.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229

    Post


    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.

  3. #3
    Hyperactive Member
    Join Date
    Jul 1999
    Location
    NY, USA
    Posts
    270

    Post

    The following code just simply opens the default browser (if not already opened) and navigates to a site.

    Module Code:
    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
    Code:
    Private Sub Command1_Click()
        LaunchSite Me, "http://www.vb-world.net"
    End Sub
    Obvioulsy, the site doesn't have to be VB-World and doesn't have to be under Command1, but you get the idea.

    ------------------
    Tom Young, 14 Year Old
    tyoung@stny.rr.com
    ICQ: 15743470 Add Me ICQ Me
    AIM: TomY10
    PERL, JavaScript and VB Programmer

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 1999
    Posts
    229

    Post


    Thanks Compwiz, I'll try your code.


  5. #5
    Lively Member
    Join Date
    Jan 1999
    Location
    Lincolnshire, UK
    Posts
    111

    Post

    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

  6. #6
    Lively Member
    Join Date
    Jan 1999
    Location
    Lincolnshire, UK
    Posts
    111

    Post

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width