0

Hi

I've written a printing application which is working perfectly when I debugg and step through but does not print anything when running a debugg with no breaks / step through.

I suspect I need to use something like Do Events to get the application to print out. However when I type it in, Visual studio 2008 doesn't seam to recognise it. I did find the

System.Threading.Thread.Sleep

Should I be using this instead? and could anyone give me an example of how to use it?
i.e should I be doing :

'printing to word....
oDoc.PrintOut(Range:=WdPrintOutRange.wdPrintAllDocument, Item:=WdPrintOutItem.wdPrintDocumentContent, Copies:=1)
System.Threading.Thread.Sleep(10)

OR

System.Threading.Thread.Sleep(10)
oDoc.PrintOut(Range:=WdPrintOutRange.wdPrintAllDocument, Item:=WdPrintOutItem.wdPrintDocumentContent, Copies:=1)

Thanks in advance

1
Contributor
1
Reply
3
Views
7 Years
Discussion Span
Last Post by G_Waddell
0

Hi

I've written a printing application which is working perfectly when I debugg and step through but does not print anything when running a debugg with no breaks / step through.

I suspect I need to use something like Do Events to get the application to print out. However when I type it in, Visual studio 2008 doesn't seam to recognise it. I did find the

System.Threading.Thread.Sleep

Should I be using this instead? and could anyone give me an example of how to use it?
i.e should I be doing :

'printing to word....
oDoc.PrintOut(Range:=WdPrintOutRange.wdPrintAllDocument, Item:=WdPrintOutItem.wdPrintDocumentContent, Copies:=1)
System.Threading.Thread.Sleep(10)

OR

System.Threading.Thread.Sleep(10)
oDoc.PrintOut(Range:=WdPrintOutRange.wdPrintAllDocument, Item:=WdPrintOutItem.wdPrintDocumentContent, Copies:=1)

Thanks in advance

Got it working now.....

'printing to word....
oDoc.PrintOut(Range:=WdPrintOutRange.wdPrintAllDocument, Item:=WdPrintOutItem.wdPrintDocumentContent, Copies:=1)
System.Threading.Thread.Sleep(10)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.