Results 1 to 8 of 8

Thread: new browser window code?

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    USA
    Posts
    37

    Post

    I am displaying a banner in my prog. and I was wondering how I could force the browser to open any links in a new window?

  2. #2
    Guest
    Code:
    Private Sub webbrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
         Dim F As New Form1
         Set ppDisp = F.webbrowser1.Object
         Cancel = False
         DoEvents
         F.Show
    End Sub

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    USA
    Posts
    37
    This code didnt work. I want a new window, in internet explorer, not my program, to open and display the site which the banner linked to.

  4. #4

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    USA
    Posts
    37
    This code didnt work. I want a new window, in internet explorer, not my program, to open and display the site which the banner linked to.

  5. #5
    Member
    Join Date
    Sep 2000
    Location
    New Orleans, LA
    Posts
    37
    'this in your general declarations:

    Private 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

    'this in your event that you want to launch the browser from:

    Call ShellExecute(hwnddesk, "Open", "www.YourURLHere.com", directory, 0&, vbNormal)


  6. #6
    Guest
    Or without API, simply use the standard Shell method and pass the website as an argument.
    Code:
    Shell "C:\Program Files\Internet Explorer\IExplore.exe http://www.excite.com", 1

  7. #7

    Thread Starter
    Member
    Join Date
    Oct 2000
    Location
    USA
    Posts
    37
    Let me clarify what i want. I need code that would open a new internet explorer window when the user clicks the rotating banner on my form, and display which ever link was clicked. I NEED HELP!!!!!!

  8. #8
    Guest
    ST15XA, that will open a new window! Use Megatron's code, it will open a new window always.

    Are you wanting to add the Microsoft Internet Controls as a reference so that you can use IE? It would take up resources, but...

    What the customer wants, the customer gets

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