function printTransactionDetails(htmlString)
'set objShell = CreateObject("Shell.Application")
'msgbox objShell
Const OLECMDID_SAVE = 3
Const OLECMDID_SAVEAS = 4
Const OLECMDID_PRINT = 6
Const OLECMDEXECOPT_DONTPROMPTUSER = 2
Const PRINT_WAITFORCOMPLETION = 2
MsgBox ("amogh0")
Set ie = CreateObject("InternetExplorer.Application")
'Set ie = new InternetExplorer
MsgBox ("amogh1")
'navigate to blank page so that the document object is available
ie.navigate "about:blank"
ie.visible=0
'msgbox ie.document.body.innerHTML
ie.document.body.style.margin = 20
ie.document.body.innerHTML=htmlString
'msgbox ie.document.body.innerHTML
ie.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER,PRINT_WAITFORCOMPLETION
'Quit IE
ie.quit
end function
我有一个 JSP,其中有上面的代码 .. 它用于打印。当我使用 https://loclhost:8444/MyApp 时,CreateObject("InternertExplorer.Application") 抛出错误,而当我使用 https://10.192.51.xx:8444/MyApp 时它工作