How can i wait till document is printed ?

Started by ivan, March 23, 2010, 09:38:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ivan

i use followig code for MS Word for example
i print to pdf factory printer
While Application.BackgroundPrintingStatus > 0
        'Application.Wait (Now() + TimeValue("00:00:01"))
        Sleep 1 * 1000
        tim = tim + 1
        'Debug.Print tim
        Wend
        Debug.Print "print time " & tim & " sec"

when printing is done i can rename\move resulting file if i need. But i have to wait till printing is done.
Any way to do it in Visio VBA ? is there analogue for "BackgroundPrintingStatus" ?
of course i can just use a pause several seconds long but that's not the way i like it

Paul Herber

I don't think there is any way to know. Once Visio has generated its print output it gets spooled to the print driver, this output could be buffered within your PC. the printer itself or a print spooler. All you know is when Visio has finished.
Electronic and Electrical engineering, business and software stencils for Visio -

https://www.paulherber.co.uk/

Yacine

guess that's exactly what is wanted - to know when Visio/the document is available again.
Word also shows only when it finishes it's job, not when the paper leaves the printer.
So the question is, "when has Visio finished?"
Yacine