none
VB Script based HTML Application (HTA) RRS feed

  • Question

  • I'm inheriting a HTML Application (.HTA) which I would like to develope with the aid of a debugger.  Is there a way to utilize Visual Studio or some other tool to get a debugger to work with the existing HTA?

    Thanks

    John Fors

    Monday, January 13, 2014 8:40 PM

Answers

  • Hi,

    I couldn't find a way to do it... either with IE Developer tools or the VS debugger.

    http://msdn.microsoft.com/en-us/library/aa290350(v=vs.71).aspx

    the only way I think is to use alert or messagebox statements to query variable values.

    hta is just html with a htm(l) extension and a <hta:application> namespace element.

    for debugging purposes you can rename your hta file to a htm extension.

    eg. foo.hta >> foo.htm

    add the mark of the web and the system dtd at the top of the document. and to use vbscript you will also need to use a x-ua meta tag to force IE into a documentMode that will accept the vbscript type value... (vbscript was depreciated in IE10, so your HTA's should use javascript I/o vbscript unless you want to access the registry or file system)

    eg.

    <!DOCTYPE html>
    <!-- saved from url=(0014)about:internet -->
    <html xmlns:mshelp="http://msdn.microsoft.com/msHelp">
    <head>
        <title>showModelessDialog Method</title>
        <meta http-equiv="Content-Type" content="text/html; CHARSET=iso-8859-1">
        <meta http-equiv="x-ua-compatible" content="ie=8">
        <hta:application 
        id="oHTA" applicationname="ShowModalDialog Wizard" 
        resizeable="no"
        border="none" 
        caption="yes" 
        contextmenu="no" 
        icon="Start.gif" 
        innerborder="no" 
        maximizebutton="no" 
        navigatable="no" 
        scroll="no" 
        scrollflat="yes" 
        selection="no" 
        showintaskbar="yes" 
        singleinstance="yes" 
        sysmenu="yes" 
        windowstate="normal">
    
    <script type="vbscript">
    .....
    </script>
    </head>
    <body>

    Then you can open the renamed hta (now a htm file) in a web browser and use the Developer tool to debug it.

    rename it back to the hta extension to test.


    Rob^_^

    • Marked as answer by Yanping Wang Monday, January 20, 2014 11:50 AM
    Wednesday, January 15, 2014 5:20 AM