Sub PrintPDFDocument() Dim strDocument As String, strExecutable As String strPrinterName = Application.ActivePrinter strDriverName = GetPrinterDetails.DriverName strPortName = GetPrinterDetails.PortName strExecutable = GetExecutablePath("pdf") ' get the path to Acrobat Reader If Len(strExecutable) > 0 Then ' Set the current cell to A1 Range("I1").Activate ' Loop until we get to the end of the data Do While Not ActiveCell.Row = Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row strDocument = ActiveCell.Cells.Value Shell strExecutable & " /p " & strDocument ' Can't seem to get the following bit of code to work for some reason ' Shell strExecutable & " /t " & strDocument & " " & strPrinterName & " " & strDriverName & " " & strPortName ActiveCell.Offset(1, 0).Range("I1").Select Loop End If End Sub
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE