Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with printing HTML 1

Status
Not open for further replies.

StoyanM

Programmer
May 8, 2006
1
BG
I need a function that prints HTML document that is single page A4
Now I do this so:

#DEFINE OLECMDF_SUPPORTED 1 &&Command is supported by this object.
#DEFINE OLECMDF_ENABLED 2 &&Command is available and enabled.
lcHtml = "c:myPage.html"

oleHtml=CREATEOBJECT("internetexplorer.application")
oleHTML.navigate( lcHtml )
DO WHILE oleHTML.QueryStatusWB(6) != (OLECMDF_SUPPORTED + OLECMDF_ENABLED)
DOEVENTS
ENDDO

oleHTML.ExecWB(6, 2, 0, 0)
FOR j=1 TO 15
=Sleep(100)
DOEVENTS
NEXT

RELEASE oleHtml

This works correctly except with some big pages.
I don't know a manner to test whether print operation succeeds, therefore I do a LOOP after ExecWB.
I suppose tere is a better way to do this.

Thanks in advance for any help
 
How about using thread184-1141163 and looping while between(objPrinter.PrinterStatus, 4, 5)?

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top