Hi John,

I'm using something very similar to what you tried. The code below is Delphi
but the syntax isn't very different to VB so you should be able to use it.

while mzGecko.Busy and (mzGecko.QueryStatusWB(OLECMDID_PRINT) < 1) do
  Application.ProcessMessages;
mzGecko.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_PROMPTUSER);

mzGecko is my Mozilla Control. The Application.ProcessMessages method is
used to tell the app to process the windows message loop so that it doesn't
appear to have hung. I think it is probably equivalent to your DoEvent call.

You might be able to help me, have you tried to show the Page Setup dialog?
I'm using the following command but keep getting an OLE exception:
mzGecko.ExecWB(OLECMDID_PAGESETUP, OLECMDEXECOPT_PROMPTUSER)

Hope this helps,
Dave.

-- 

"John" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> [EMAIL PROTECTED] (Dave Murray) wrote in message
news:<[EMAIL PROTECTED]>...
> >
> > There is a way to test the control to see if it is ready to print but
> > I can't remember the code and don't have it with me at work. I'll post
> > a follow-up from home that shows how to implement a loop that waits
> > for the printer to be ready before printing.
> >
> > Hope this helps.
> >
> > Thanks,
> > Dave.
>
> Please do let me know how to implement that loop - I tried something
> similar but I couldn't get it to work (to ever exit the loop
> successfully)
> The code was something like this (this is from memory so it prob has
> some errors)
> while MozCtrl.QueryStatusWB(OLECMDID_PRINT) And OLECMDF_ENABLED <>
> True
>    DoEvent
> Wend
> MozCtrl.ExecWB OLECMDID_PRINT, ....
>
> The conditional always evaluated to true and therefore the ExecWB line
> would never be executed.
>
> I have worked around this by 1) using the Internet Explorer control
> (which originally wouldn't print satisfactorily) 2) placing the ExecWB
> command in the NavigateComplete event.
>
> Thanks for your response.
>
> - John



Reply via email to