colinharwood
Active Member
- Joined
- Jul 27, 2002
- Messages
- 437
- Office Version
- 365
- Platform
- Windows
CreatePDF:
Application.ScreenUpdating = False
CreateObject("WScript.Network").SetDefaultPrinter "Microsoft Print to PDF"
'copy details & save to PDF file
Range("$A$1:$H$45").Select
ThisFile = Range("N5").Value & " " & Range("O5").Value
FileDrive = "C:\TMES Email Renewals\"
Selection.PrintOut Copies:=1, ActivePrinter:= _
"Microsoft print to pdf", Collate:=True, _
printtofile:=True, prtofilename:=FileDrive & ThisFile & ".pdf"
Sheets("PDF Membership Card").Range("S1").Select
When using this code , It changes the default printer to "Microsoft Print to PDF". Is there a way to get the name of the original default printer, to use as a variable , to reset the default printer after printing to "Microsoft Print to PDF"
Thanks
Application.ScreenUpdating = False
CreateObject("WScript.Network").SetDefaultPrinter "Microsoft Print to PDF"
'copy details & save to PDF file
Range("$A$1:$H$45").Select
ThisFile = Range("N5").Value & " " & Range("O5").Value
FileDrive = "C:\TMES Email Renewals\"
Selection.PrintOut Copies:=1, ActivePrinter:= _
"Microsoft print to pdf", Collate:=True, _
printtofile:=True, prtofilename:=FileDrive & ThisFile & ".pdf"
Sheets("PDF Membership Card").Range("S1").Select
When using this code , It changes the default printer to "Microsoft Print to PDF". Is there a way to get the name of the original default printer, to use as a variable , to reset the default printer after printing to "Microsoft Print to PDF"
Thanks