Ooit gevonden. mag je zelf aan werken.
De macro slaat de ActivePrinter op en maakt Adobe PDF de ActivePrinter en print
Daarna zet hij de eerste printer weer terug
Sub Test()
Dim str As String
Dim strNetworkPrinter As String
str = Application.ActivePrinter
strNetworkPrinter = GetFullNetworkPrinterName("Adobe PDF")
If Len(strNetworkPrinter) > 0 Then
Application.ActivePrinter = strNetworkPrinter
ActiveSheet.PrintOut
End If
Application.ActivePrinter = str
End Sub
Function GetFullNetworkPrinterName(strNetworkPrinterName As String) As String
Dim strCurrentPrinterName As String, strTempPrinterName As String, i As Long
strCurrentPrinterName = Application.ActivePrinter
i = 0
Do While i < 100
strTempPrinterName = strNetworkPrinterName & " on Ne" & Format(i, "00") & ":"
On Error Resume Next ' try to change to the network printer
Application.ActivePrinter = strTempPrinterName
On Error GoTo 0
If Application.ActivePrinter = strTempPrinterName Then
GetFullNetworkPrinterName = strTempPrinterName
i = 100 ' makes the loop end
End If
i = i + 1
Loop
Application.ActivePrinter = strCurrentPrinterName ' change back to the original printer
End Function
!!!!!!!!!!!
"In de funcie verander on in op omdat je een Nederlandse machine hebt denk ?
> strTempPrinterName = strNetworkPrinterName & " on Ne" & Format(i, "00") & ":"
groet uit mooi Drunen
Groet uit mooi Drunen.