bradmitchell
New Member
Hi I have copied VBA from user sgmpatnaik thankyou to this user, the code works great I just don't know how to add more pdf's to print at the same time.
what I have are multiple PDF's id like to print from a single button click, they are inductions for staff, different staff have different inductions, I want to set up several buttons to batch print the appropriate paperwork for the corresponding staff.
eg
I have this command
and this module
I have another file in folder path X:\HR\02. INDUCTIONS\LOAD RESTRAINT.pdf that I would like to print on the same button click.
I dont know anything about how to move forward here as I have next to no skill with this, any assistance would be appreciated greatly
what I have are multiple PDF's id like to print from a single button click, they are inductions for staff, different staff have different inductions, I want to set up several buttons to batch print the appropriate paperwork for the corresponding staff.
eg
I have this command
Code:
Option Compare Database
Private Sub Command4_Click()
Call testPrint
End Sub
Code:
Option Explicit
Public Declare Function ShellExecute 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
Public Function PrintThisDoc(formname As Long, FileName As String)
On Error Resume Next
Dim X As Long
X = ShellExecute(formname, "Print", FileName, 0&, 0&, 3)
End Function
Sub testPrint()
Dim printThis
Dim strDir As String
Dim strFile As String
strDir = "X:\HR\02. INDUCTIONS"
strFile = "ANTI BULLYING PROCEDURE.pdf"
printThis = PrintThisDoc(0, strDir & "\" & strFile)
End Sub
I dont know anything about how to move forward here as I have next to no skill with this, any assistance would be appreciated greatly
Last edited by a moderator: