Results 1 to 5 of 5

Thread: open web page in brwoser from vb

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2003
    Posts
    1

    Question open web page in brwoser from vb

    Hi,

    I'm trying to open a HTMl document in the default web browser just by clicking a button in my vb program. Does anyone have any tips or placews where i can go to look at sample code?

    Thanks

  2. #2
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Re: open web page in brwoser from vb

    Originally posted by ericdg
    Hi,

    I'm trying to open a HTMl document in the default web browser just by clicking a button in my vb program. Does anyone have any tips or placews where i can go to look at sample code?

    Thanks
    Wait a sec, searching... I had this in the simplest program provided by VBWORLD!

    ... Search in progress...

    Oh and damn, cant find it... I'll post it back later, Im at school and dont have all my programs here... And I cant seem to remember the function by heart!

    You could however, add a control to browse...

    And use the

    VB Code:
    1. WebBrowser.Navigate PathAndFilenameOfHtmlDocument

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

  3. #3
    Addicted Member
    Join Date
    Sep 2000
    Location
    Atlanta, GA
    Posts
    177

    This has been addressed about 2 or 3 times

    Try searching for WebBrowser:

    For all of you in need it's your friend in deed! Here is the code to display Web Pages offline in a Web Browser control:

    'WebBrowser must first navigate to a HTML file.
    WebBrowser1.Document.Open
    WebBrowser1.Document.Write rtfEdit.Text
    WebBrowser1.Document.Close


    Stay tuned to find out how to display ASP pages offline!

    HOLLA!!!!!!!

    NOTE: This should work with any type of text box. Sorry about the other two post I didn't know if they went through becuase they didn't show up.
    212 will lead you to the truth

  4. #4
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    VB Code:
    1. Public 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
    2.  
    3. Private Sub Command1_Click()
    4.     ShellExecute Me.hWnd, "Open", "http://www.msn.com",0,0,3
    5. End Sub

  5. #5
    Fanatic Member Ruku's Avatar
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    655

    Arrow AH HA!

    Originally posted by andreys
    VB Code:
    1. Public 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
    2.  
    3. Private Sub Command1_Click()
    4.     ShellExecute Me.hWnd, "Open", "http://www.msn.com", 0, 0, 3
    5. End Sub

    This was exacly what I wuz searching for, ! Its in almost every program of VBWORLD, ... to visit the authors webpage... But with the new construction of vbworld, I couldn't find the new download section!

    Well, hope it helps!

    Using VB.NET 2005/.NET 2.0, NetBeans IDE 5, Fujitsu Cobol85,
    Website: http://DreamForgery.com

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