+ Reply to Thread
Results 1 to 2 of 2

Calling the Windows Deafult Printer

  1. #1
    Simon Peers
    Guest

    Calling the Windows Deafult Printer

    How can I set the Windows Default Printer?

    I am trying to set the printer back to the default printer after getting it
    to print to a specific printer.

    Does anyone know the specific code to do this?

    I am calling this from Access but it is still basic code, here is hwat I
    have tried:

    'Print Invoice to PDF File
    With xlSheet.PageSetup

    xlSheet.Application.ActivePrinter = "CutePDF Writer on CPW2:"
    End With
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
    "CutePDF Writer on CPW2:", Collate:=True

    With xlSheet.PageSetup
    xlSheet.Application.ActivePrinter = "WindowsDefaultPrinter" = True
    End With

    The first bit works perfectly, captures the printer (PDF writer in this
    case) and I need to be able to reset it back to the Windows Default Printer
    as I I will not know what this printer is called.

    xlSheet.Application.ActivePrinter = "***WindowsDefaultPrinter***" = True

    The text between the stars gives errors not surprisingly, If this was
    correct I think it would work.


    Many thanks



  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Simon,

    I posted this yesterday, but no problem to post it again. This works for Excel and should work in Access also. Since the both use the same caommand to set the printer.

    Example:
    Application.ActivePrinter = GetDeafultPrinter

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1