I have a VB.net application that reads a series of records and creates a word document from them in large batches daily. THe program loads a word template from SQL Server, grabs the shapes and replaces the text within it, and then calls PrintOut(). What we are finding is that after 8 months of daily use, all of a sudden, some of the documents are not coming out on the printer end. All the history and 'trace' records in our database show that the document was processed, and I even went so far as to add a second PrintOUt() function that prints to file directly after the PrintOUt() to the printer has happened, and that file is there, so I am at a loss. Everyone feels that the problem is with the printer, but what my client would like to do is have me generate a report that would inform someone that certain documents didn't print.
I have spent some time trying to determine if there is a way to determine if a document successfully printed, but I am having trouble finding anything. Can anyone help?
Here is a snippet of the print code I am using...
If chkPrintPageStart <> 0 And chkPrintPageEnd <> 0 Then
From:=CStr(chkPrintPageStart), To:=CStr(chkPrintPageEnd), PrintToFile:=False)
If (debugPrinter) Then
aDoc.PrintOut(PrintToFile:=True, OutputFileName:="C:\\DebugPrinter\\" & _
CStr(aCheck.CheckNumber) & ".doc")
IN all cases, the line aDoc.PrintOut(PrintToFile:=False) is the one executed in this context, as for this application we are always printing the entire document. I would think PrintOUt() would throw an exception if there was a problem, but I don't recieve anything in the catch that surrounds all this code. WE have checked the eventlog and all as well and no problems surface there. It just appears that the print request is lost in the ether.....
Thanks in advance for your help!!