Advertisement
Advertisement
| 07.09.2008 at 06:34PM PDT, ID: 23552443 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: |
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
|