Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts

    Dynamically loaded HTA

    I've found that HTA seems to suit my needs for a project I am working on, I thought that an HTA file acts similarly to an EXE. What I'm trying to do is launch an HTA front end to an access database, when the DB is executed. When I was using html extensions, I was able to create my HTML and JS files on the local file system (The code is all in the DB) launch IE and load up the freshly created files. Now that there is an HTA extension I thought I might be able to just launch the HTA directly, but to no avail. Now I get a do you want to download or open prompt. Which honestly is worse than the active X prompt I was getting before. Is there a way to load up \ execute an HTA dynamically in VB for applications, without a prompt?

    This is what I have when it is an html file:
    Code:
    stAppName = "C:\Program Files\Internet Explorer\IEXPLORE.EXE file:\\C:\Documents and Settings\" & Environ$("USERNAME") & "\Local Settings\Application Data\BMS\main.hta"
        Call Shell(stAppName, 1)
    and when I switched to hta I thought I'd try:

    Code:
    stAppName = "C:\Documents and Settings\" & Environ$("USERNAME") & "\Local Settings\Application Data\BMS\main.hta"
        Call Shell(stAppName, 1)
    The top one will load the hta, but only after the prompt to save or open, while the bottom does nothing.

    Ah Hah, I think I figured it out, somewhat. It doesn't open with IE by default, it opens with Microsoft (R) HTML application host. In which case can I shell execute that in lieu of IE and specify the file just as above? If so, where is it?

    Basscyst
    Last edited by Basscyst; 11-24-2004 at 12:35 AM.
    Helping to build a bigger box. - Adam Matthews

  • #2
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It should be in the system root directory, so an absolute path would not need to be supplied, but anyway, if you shellExecute() the .hta file, it should open with its default app...
    *this message will self destruct in n-seconds*

  • #3
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    That's what I would think too (just shell exec the hta), it just sits there though.

    I got it to work, by doing this:

    Code:
     stAppName = "mshta.exe file:\\C:\Documents%20and%20Settings\axmathe\Desktop\Copy%20of%20ERS\bms.hta"
        Call Shell(stAppName, 1)
    Excellent!! Thanks again for your help with this CGB!

    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #4
    Regular Coder
    Join Date
    Aug 2004
    Location
    codegoboom@yahoo.com
    Posts
    999
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ah, shellExecute is a method that can only be invoked from script, according to the ref... now that I check.
    *this message will self destruct in n-seconds*

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    1,137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i have a post about HTA's and MS access databases, as i used it for a college project.

    http://www.codingforums.com/showthre...hlight=scroots

    If you need any help i have all my code from my project last year.

    scroots
    Spammers next time you spam me consider the implications:
    (1) that you will be persuaded by me(in a legitimate mannor)
    (2)It is worthless to you, when i have finished

  • #6
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Yep, that's the code that got me started with the db driven version, I was using text files before. Thanks a million, I use it every day. Took me a year to put 2 and 2 together and realize what an hta was though. I'd been using it through IE and an HTML extension.

    Basscyst
    Helping to build a bigger box. - Adam Matthews

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    UK
    Posts
    1,137
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm glad someone other than myself had a use for it.

    It makes me happy, that i have produced something that is useful to others out of an almost meaningless project.

    I found <div></div> Helpful as you can run a function, query, and return the results without a refresh.

    scroots
    Spammers next time you spam me consider the implications:
    (1) that you will be persuaded by me(in a legitimate mannor)
    (2)It is worthless to you, when i have finished

  • #8
    Smokes a Lot
    Join Date
    Jul 2003
    Location
    CA, USA
    Posts
    1,594
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Yep exactly, I have gotten deep with it in the past year, my current project is reaching about 4000 lines of javascript. Great fun, and I worked around all our IT departments limitations for servers, and type of files that can be stored and where they are stored on our network.

    Basscyst
    Helping to build a bigger box. - Adam Matthews


  •  

    Posting Permissions

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