PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: paulDiagnos on June 11, 2007, 07:05:44 AM

Title: HTML ocx control printing
Post by: paulDiagnos on June 11, 2007, 07:05:44 AM
Hi guys,

Does anyone know how to start the printing process for html documents in the ocx control

this is my code below, with added stuff from another post but doesnt seem to work ?

vVar =htmlfile
Object Call DISPATCH_html_htmlOCX.Navigate(VvAR)
Dim vID As Variant, vOpt As Variant
vID = 6 AS LONG  ' %OLECMDID_PRINT
vOpt = 1 AS LONG  ' OLECMDEXECOPT_PROMPTUSER
Object Call DISPATCH_html_htmlOCX.ExecWB(vID, vOpt)

any ideas?

thanks Paul.
Title: Re: HTML ocx control printing
Post by: paulDiagnos on June 11, 2007, 10:58:23 AM
FOr some reason if i put

Dim vID As Variant, vOpt As Variant
vID = 6 As Long  ' %OLECMDID_PRINT
vOpt = 1 As Long  ' OLECMDEXECOPT_PROMPTUSER
Object Call DISPATCH_html_htmlOCX.ExecWB(vID, vOpt)                      

in another function it works.
never mind problem solved.
Title: Re: HTML ocx control printing
Post by: Paul D. Elliott on June 11, 2007, 02:32:13 PM
Just a wild guess but maybe the .Navigate physically takes some time to execute and needs
a slight delay before you start trying to print.

Just a thought.
Title: Re: HTML ocx control printing
Post by: paulDiagnos on June 12, 2007, 09:35:16 AM
i think your right. a sleep function managed to do it too .
Title: Re: HTML ocx control printing
Post by: paulDiagnos on April 02, 2009, 12:09:03 PM
Ok breathing life into this question again ...


Erm how come this code does not work for Vista? :-( making life hell again

Paul.
Title: Re: HTML ocx control printing
Post by: paulDiagnos on April 14, 2009, 06:56:28 AM
hmm bit of a arse this problem.

but as is my speciality i have found away round it.
open the html document using shell execute, and let the User print using explorer.

bit cheaty but im sick of this problem :-)