I have a small VB application that retrieves a recordset of DocIds from a FileNet database. Using a loop the program prints the document(PDF) or each record through to the printer specified by the user. The code to print the document is:
RequestId = doc.DoPrint(idmPrintNative, Array(1, 100))
The problem I am having is that when there are numerous reocrds in the recordset I get a Acrobat error saying "There was an error opening the document".
I found out that I need to slow processing down to enable the documents to print correctly.
This was kinda of trial an error on how to do this. First i tried a DoEvents, and that didnt work, then I tried the Sleep API and that didnt work. Finally after being very frusterated I decided to pop up a msg box for every record. When the user clicks ok on the msgbox no matter how fast the document prints correctly. So what I have done, is open message boxes and then close them through a seris of API calls. The problem with this is that it is very slow and does not allow the user to do anything else with there machine while the application is running be/c the msgbox steals the focus.
Basically i don't know why the message box works and sleep or doevents does not. I have even tried opening and closing a Modal dialog programatically to trigger an event. I need something that does what the messagebox does with out having to open one and not have it take so much time.
Hopefully this does not confuse anyone, I have tried to make myself as clear as possible, if any further clarification is necessary please let me know. Thanks in advance.
RequestId = doc.DoPrint(idmPrintNative, Array(1, 100))
The problem I am having is that when there are numerous reocrds in the recordset I get a Acrobat error saying "There was an error opening the document".
I found out that I need to slow processing down to enable the documents to print correctly.
This was kinda of trial an error on how to do this. First i tried a DoEvents, and that didnt work, then I tried the Sleep API and that didnt work. Finally after being very frusterated I decided to pop up a msg box for every record. When the user clicks ok on the msgbox no matter how fast the document prints correctly. So what I have done, is open message boxes and then close them through a seris of API calls. The problem with this is that it is very slow and does not allow the user to do anything else with there machine while the application is running be/c the msgbox steals the focus.
Basically i don't know why the message box works and sleep or doevents does not. I have even tried opening and closing a Modal dialog programatically to trigger an event. I need something that does what the messagebox does with out having to open one and not have it take so much time.
Hopefully this does not confuse anyone, I have tried to make myself as clear as possible, if any further clarification is necessary please let me know. Thanks in advance.