I would like to print all the works orders for a job so that they come out on the printer in the correct order - so I have the first Works order print then the associated PDF then the next works order and so on.
I have code to loop through each works order print the works order, then print the PDF and then print the next works order. Using adobe reader to print.
The problem is that for the PDF to print it needs to open adobe reader which displays on the screen and takes some time to print - in the mean time all the access reports (works order) have printed and then the PDF's start.
I am using the below code to print the PDF - strfilelink is the directory location of the PDF e.g. C:\TestPDF.pdf.
Does anyone know of a better way of printing PDF's or a way to delay the printing the next Works order until the PDF is printed.
Be nice not to have adobe open up on the screen - happy to consider other PDF readers.
Public Declare Function ShellExecuteAPI Lib "Shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Call ShellExecuteAPI(Application.hWndAccessApp, "print", strfilelink, "", "", 0)