Valeu irmão. Muito obrigado deu certinho aqui.
Ficou assim o codigo. Setei na célula "A1" a quantidade de cópias.
Option Explicit
Public Declare PtrSafe 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 testandoimpressao()
Dim i As Integer
Dim printThis
Dim strDir As String
Dim strFile As String
For i = 1 To Range("a1").Value
strDir = "D:teste" 'Mude para o local onde está o arquivo
strFile = "levantar.pdf" 'Nome do arquivo
printThis = PrintThisDoc(0, strDir & "" & strFile)
Next i
End Sub
Lucélio Ferreira dos Santos
Eng. Eletricista
CREA: DF-7165/TD
[email protected]
Postado : 14/04/2015 2:12 pm