Results 1 to 8 of 8
  1. #1
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Activating Firefox via VB .NET (VB .NET)

    Using the following VB .NET Code activates IE.

    <pre>Dim t As Type = Type.GetTypeFromProgID("InternetExplorer.Applicati on")
    Dim o As Object = Activator.CreateInstance(t)
    t.InvokeMember("Visible", BindingFlags.SetProperty, Nothing, o, New Object() {True})
    t.InvokeMember("Navigate", BindingFlags.InvokeMethod, Nothing, o, New Object() {www.microsoft.com})
    </pre>


    Substituting the following for the Dim t line, I thought that I'd be able to activate Firefox. Did not work.
    Can Firefox be activated in .NET code using the ProgID?

    <pre>Dim t As Type = Type.GetTypeFromProgID("Mozilla.Browser.1")
    </pre>


  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Activating Firefox via VB .NET (VB .NET)

    Butting in where I probably should not tread, but those look like COM-type references, which probably require a registry entry. Firefox does not, as far as I can tell, register itself under HKEY_CLASSES_ROOT like IE does.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Activating Firefox via VB .NET (VB .NET)

    You're right, Jefferson. The help on GetTypeFromProgID specifically says that the return value is
    <hr>The type associated with the specified ProgID, if progID is a valid entry in the registry and a type is associated with it; otherwise, a null reference (Nothing in Visual Basic).<hr>
    So if Firefox doesn't create a registry entry, then this method couldn't be used to return a reference to it.
    Charlotte

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Activating Firefox via VB .NET (VB .NET)

    Firefox is registered.

    It's Mozilla.Browser.1 with a clsid of {1339B54C-3453-11D2-93B9-000000000000}.

  5. #5
    Platinum Lounger
    Join Date
    Jan 2001
    Posts
    3,788
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Activating Firefox via VB .NET (VB .NET)

    I have never used it myself but if you want to control Firefox you may have to learn XPCOM. Another page on Mozilla about it is Cross Platform Component Object Model (XPCOM)

  6. #6
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Activating Firefox via VB .NET (VB .NET)

    I know about XPCOM, but i Do not belive it hooks into VB.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Activating Firefox via VB .NET (VB .NET)

    <P ID="edit" class=small>(Edited by jscher2000 on 10-Mar-05 21:04. )</P>That's odd. I don't have that CLSID in my registry, either. Did you ever install the Mozilla suite or any other Mozilla Foundation software??

    Added: Googling returns useful stuff like this.

  8. #8
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Activating Firefox via VB .NET (VB .NET)

    I installed Firefox 1.0 and a few weeks later Thunderbird 1.0, then recently Firefox 1.0.1.

    It does seem that the Mozilla folkes intentionally do not provode support for VB/VBA.

Posting Permissions

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