Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Nov 2005
    Location
    London, Gtr London, United Kingdom
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Active Printer question (VBA/Word/2000)

    Hi everyone.

    I'm having a bit of a problem with default printers.

    I'm using the following code in a document to print a document to distiller but after it's done, the default printer for all applications is now distiller.

    ActivePrinter = "Acrobat Distiller"
    Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
    wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
    Collate:=True, Background:=True, PrintToFile:=False, PrintZoomColumn:=0, _
    PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0

    I know that I could easily put an ActivePrinter line in and change it back to my normal printer, but other people are going to be using the document and they all have different printers!

    is there a way to stop the code doing this?

    many thanks

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Active Printer question (VBA/Word/2000)

    Hi,
    You can do something like:
    <pre>strCurrentPrinter = ActivePrinter
    ActivePrinter = "Acrobat Distiller"
    Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
    wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
    Collate:=True, Background:=True, PrintToFile:=False, PrintZoomColumn:=0, _
    PrintZoomRow:=0, PrintZoomPaperWidth:=0, PrintZoomPaperHeight:=0
    activeprinter = strcurrentprinter
    </pre>


    HTH
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    Star Lounger
    Join Date
    Nov 2005
    Location
    London, Gtr London, United Kingdom
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Active Printer question (VBA/Word/2000)

    Brilliant

    Thanks Rory, works a treat

    Take care

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •