HTML ocx control printing

Started by paulDiagnos, June 11, 2007, 07:05:44 AM

Previous topic - Next topic

paulDiagnos

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.

paulDiagnos

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.

Paul D. Elliott

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.

paulDiagnos

i think your right. a sleep function managed to do it too .

paulDiagnos

Ok breathing life into this question again ...


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

Paul.

paulDiagnos

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 :-)