dcsimg
Results 1 to 5 of 5

Thread: how to open mozilla firefox using this code

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    161

    how to open mozilla firefox using this code

    I found some code in http://planet-source-code.com
    and run good
    but when run project and click command button open IE. I want open mozilla firefox and run good how can this
    code here

    form1


    Dim captIE As New SHDocVw.InternetExplorer
    Dim captieclass As New Class1

    Private Sub Command1_Click()
    captIE.Visible = True
    captIE.Navigate Text1.Text
    End Sub

    Private Sub Form_Load()
    Set captieclass.captx = captIE
    End Sub

    class1

    Public WithEvents captx As SHDocVw.InternetExplorer
    Private Sub captx_StatusTextChange(ByVal Text As String)
    Form1.Text1.Text = Text
    Form1.List1.AddItem Now & " - " & Text
    End Sub

  2. #2
    Member
    Join Date
    May 2017
    Posts
    57

    Re: how to open mozilla firefox using this code

    Wouldn't it be easier just to use:


    Code:
    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
    
    Sub OpenFirefox
          
          lRet = ShellExecute(Me.hwnd, "open", "C:\Program Files\Mozilla Firefox\firefox.exe", "http://www.vbforums.com", vbNullString, 1)
    
    End Sub
    Last edited by MikeSW17; May 19th, 2019 at 11:00 PM.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2013
    Posts
    161

    Re: how to open mozilla firefox using this code

    any tell

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    24,303

    Re: how to open mozilla firefox using this code

    there is not current com object for firefox, so not possible in vb6

    have you looked at sellenium?
    can supposedly automate any browser by code
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    3,455

    Re: how to open mozilla firefox using this code

    Code:
    Dim captIE As New SHDocVw.InternetExplorer
    If you make a reference to InternetExplorer then ofcourse it will Internet Explorer and not any other tool.

    If you want to start FireFox then you need to find to location of the FireFox executable and start the application using the Shell command.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width