Results 1 to 11 of 11
  1. #1
    Join Date
    May 2005
    Posts
    1,191

    Unanswered: Open HTML File with Mozilla Firefox from MS Access

    I have some code that successfully creates an HTML file, no problem there. But then I'd like to open the file for the user, and here's the catch, it has to be opened exclusively with Mozilla Firefox (user default internet application may be IE or whatever the user picks, and this won't work). Anyone know how?
    Me.Geek = True

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You can call the firefox executable assuming everyone installed it in the default location calling something like "firefox.exe -url uriGoesHere" .

    If you're trying to restrict the ability to open it with IE in the first place, you'll need to rely on using javascript to evaluate the client and provide feedback accordingly.


    Just out of curiosity, why does it HAVE to be firefox?
    Last edited by Teddy; 08-04-09 at 17:38.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    May 2005
    Posts
    1,191
    Teddy,

    The file is a WordMap that needs Firefox's canvas element to make the map. IE won't work, and I don't feel like taking the time to make it work (not a big fan of IE in the first place ).

    I'll try the url and see if I can get it to work. Thanks!
    Me.Geek = True

  4. #4
    Join Date
    May 2005
    Posts
    1,191
    Hey Teddy,

    Sorry to ask such a stupid question, but my brain won't work. I tried
    Code:
    Application. run "firefox.exe -url file:///C:/wordmap.html"
    But it won't work; how do I use it again?
    Me.Geek = True

  5. #5
    Join Date
    May 2009
    Posts
    258
    Try:
    Code:
    Application. Run "firefox.exe C:\wordmap.html"
    Ax

  6. #6
    Join Date
    May 2005
    Posts
    1,191
    No, I'm afraid that doesn't work either Ax, but thanks. I don't think I'm supposed to use application. run, but I'm not sure what to use. My brain sucks.
    Me.Geek = True

  7. #7
    Join Date
    May 2005
    Posts
    1,191
    BTW, if I can get this to work, I think I'll try to generalize it and put it in the codebank.
    Me.Geek = True

  8. #8
    Join Date
    May 2005
    Posts
    1,191
    Like I said, brain wasn't working, forgot about Shell command:
    Code:
    Shell "C:\Program Files\Mozilla Firefox\firefox.exe -url file:///C:/wordmap.html"
    I'll of course have to test if Mozilla has been installed to x86 or normal folder, but I got it now.

    Cheers, and thanks all!
    Last edited by nckdryr; 08-05-09 at 16:37.
    Me.Geek = True

  9. #9
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    You could always use the shell windows api if need be. There's some sample code on mvps.org if you need it.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  10. #10
    Join Date
    May 2005
    Posts
    1,191
    I just used Allen Browne's FileExists() function to see if each file existed, if it did, used it in shell command, else threw up an error.
    Me.Geek = True

  11. #11
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Next stop should be command line reference for firefox...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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