Click to See Complete Forum and Search --> : Printing via IE/ExecWB


Tuete
August 30th, 2001, 08:42 AM
Hello,

I am using vb to print an html document. In order to get the right output(not the text file with the tags in it) I have to use an html-capable device. I was trying to do this via the IExplorer, with the ExecWB command, but this only works when I debug the specific line. (which is strange enough? it sometimes works when debugging, but when running the code without any breakpoint a message box always shows up saying that it couldnt print.)

Does anyone have any idea? I do not necessarily have to use the IE I just need to print html without having a dialog showing up(meaning as a background task)

thanks in advance

andyleno
August 30th, 2001, 11:41 AM
You should you open the HTML page in word using word object model and use word to print.

Andrew Lennon (Berlitz)
Automation Dev Engineer

Tsinghua
August 30th, 2001, 07:59 PM
Hi, you can use the follow codes:
Private Sub printHTML(strHTMLFile As String)
Call Shell("rundll32.exe C:\WINDOWS\SYSTEM\MSHTML.DLL,PrintHTML " & Chr(34) & strHTMLFile & Chr(34), vbHide)

End Sub

Tsinghua 2001/8/31 nanjing,P.R.C.