Jump to content
Macro Express Forums

dburga

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by dburga

  1. I read your question and realised I was looking for the exact same thing (I think). I have since worked it out. The actual code only ends up being 5 lines, but I have added comments so you can see what each bit does - works like a charm! '---------------------------------------------------------------- 'STEP 1 'DETERMINE THE ACTUAL NAME OF CURRENT DEFAULT PRINTER 'Retrieve name of current default printer and 'Display printer name in a message box '----------------------------------------------------------------- 'This constant is used to hold the title of the message box Const Caption As String = "The Default Printer Name Is" 'This variable is used to hold the name of the active printer Dim DefaultPrinterName As String 'Assign the active printer to the variable DefaultPrinterName = Application.ActivePrinter 'Display the message box MsgBox DefaultPrinterName, vbInformation, Caption 'THE RESULT IS A MESSAGE BOX DISPLAYING THE ACTUAL PRINTER NAME '----------------------------------------------------------------- 'STEP 2 'PRINT TO PRINTER OTHER THAN CURRENT DEFAULT '----------------------------------------------------------------- 'Retrieve name of current default printer and hold as variable '----------------------------------------------------------------- 'This variable is used to hold the name of the active printer Dim DefaultPrinterName As String 'Assign the active printer to the variable DefaultPrinterName = Application.ActivePrinter '----------------------------------------------------------------- 'Print to other printer, eg Adobe PDF (becomes default printer) '----------------------------------------------------------------- ActivePrinter = "Adobe PDF" Application.PrintOut Range:=wdPrintAllDocument, _ Item:=wdPrintDocumentContent, Copies:=1 '----------------------------------------------------------------- 'Change default printer back to original default printer '----------------------------------------------------------------- Application.ActivePrinter = DefaultPrinterName
×
×
  • Create New...