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

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)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.