Results 1 to 7 of 7

Thread: location of IE[resolved]

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    location of IE[resolved]

    ok i'm trying to open IE with a chosen webpage now does the locatrion of internet ecplorer differ with OS

    shell IExplorer(Webpage)

    would that work? whats the best way to achieve this?


    i know its possible with notepad because i've done it before,

    VB Code:
    1. Shell "notepad.exe " & sPath, vbMaximizedFocus

    also is there a way to open a webpage up in the persons own webbrowser? ie there chosen one, IE firefox etc
    Last edited by Pino; Aug 2nd, 2004 at 07:14 AM.

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    VB Code:
    1. Private Sub Command1_Click()
    2. Dim ie As Object
    3.  
    4.     Set ie = CreateObject("InternetExplorer.Application")
    5.    
    6.     ie.Navigate "http://www.vbforums.com"
    7.     ie.Visible = True
    8.    
    9.     Set ie = Nothing
    10.    
    11. End Sub

    To use the default browser, open the URL through the ShellExecute API.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787
    but how do i know what there default browser is? thanks for the code by the way

  4. #4
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Originally posted by Pino
    but how do i know what there default browser is?
    That's the idea behind ShellExecute. You don't need to know or care. The system will open the correct program for you.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  5. #5
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Originally posted by Pino
    but how do i know what there default browser is? thanks for the code by the way
    You don't need to know :

    VB Code:
    1. 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
    2. Const SW_SHOWNORMAL = 1
    3. Private Sub Form_Load()
    4.     ShellExecute Me.hwnd, "open", "www.vbforums.com", vbNullString, "C:\", SW_SHOWNORMAL
    5. End Sub


    Has someone helped you? Then you can Rate their helpful post.

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787
    thank you

  7. #7
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Originally posted by Pino
    thank you
    Just keep in mind that the ShellExecute API doesn't open the website in a new window. If there is one open, it will navigate in that one. If you want to open in a new window each time, search. There have been posts about it


    Has someone helped you? Then you can Rate their helpful post.

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