Easier to open a series or open one and print. I can do both using the Shell function, but I don't think it's very slick or reliable. It would require certain parameters to be stable, such as the location of Adobe Reader, how long it takes to open and how long it takes to send a document to the print queue. If you're looking for a Lincoln, I'm offering a Toyota Yaris, I think.
Code:
Function OpenPrintPdf()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim sql As String, sfile As String, strAcrobat As String
Dim RetVal
sql = "SELECT tblMyTable.pdfLink FROM tblMyTable WHERE [Print]=True;"
strAcrobat = "C:\Program Files\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe"
Set db = CurrentDb
Set rs = db.OpenRecordset(sql)
rs.MoveFirst
Do While Not rs.EOF
sfile = rs.Fields(0)
RetVal = Shell(strAcrobat & " /P " & Chr(34) & sfile & Chr(34), 0)
Pause (3)
SendKeys "^p~", True
Pause (3)
rs.MoveNext
Loop
SendKeys "^q", True 'key combo to close Adobe Reader
End Function
Code:
Private Sub Pause(intSecs As Integer)
Dim Start As Variant
Start = Timer
Do While Timer < Start + intSecs
DoEvents
Loop
End Sub
I think automation would be more elegant and perhaps stable, but I've never automated Adobe. I'm presuming Adobe is registered on the system. A small point, but Print is not a word I would use in my table.