{"id":37,"date":"2005-11-15T23:05:37","date_gmt":"2005-11-16T04:05:37","guid":{"rendered":"http:\/\/www.juixe.com\/techknow\/?p=37"},"modified":"2005-11-15T23:05:37","modified_gmt":"2005-11-16T04:05:37","slug":"print-html-using-ie","status":"publish","type":"post","link":"http:\/\/juixe.com\/techknow\/index.php\/2005\/11\/15\/print-html-using-ie\/","title":{"rendered":"Print HTML Using IE"},"content":{"rendered":"<p>I&#8217;ve might have mentioned before that I am not well versed in Visual Basic.  Here is a small Visual Basic script snippet that took me an afternoon to figure out.  You can use this code to print an HTML file using Internet Explorer.  After the HTML file has been printed Internet Explorer will close.<\/p>\n<pre>\nSub PrintHtml(fileName)\n    Dim objIE\n    Set objIE = WScript.CreateObject( _\n        &quot;InternetExplorer.Application&quot;, &quot;ie_&quot;)\n    objIE.Visible = True\n    objIE.Navigate filename\n    do until objIE.readystate = 4 : wscript.sleep 20 : loop\n    print_done=false\n    ' 6 = PRINT, 2 = NO USER PROMPT\n    objIE.ExecWB 6, 2\n    ' Wait until printing id done.\n    do while not print_done : wscript.sleep 50 : loop\n    objIE.Quit\nEnd Sub\n\n' Listen to ie print events\nsub ie_PrintTemplateTeardown(pDisp)\n    wscript.sleep 200\n    print_done=true\nend sub\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve might have mentioned before that I am not well versed in Visual Basic. Here is a small Visual Basic script snippet that took me an afternoon to figure out. You can use this code to print an HTML file using Internet Explorer. After the HTML file has been printed Internet Explorer will close. Sub [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":""},"categories":[11,13,3,5],"tags":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p902K-B","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/37"}],"collection":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":0,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"wp:attachment":[{"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/juixe.com\/techknow\/index.php\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}