Results 1 to 4 of 4

Thread: Set System Default Printer

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    Lisbon, Portugal
    Posts
    55

    Post

    HI!

    Anyone knows how to set the windows default printer.


  2. #2
    Lively Member
    Join Date
    Jan 2000
    Posts
    76

    Post

    Hi

    Use Printer.trackdefault Property

    Good Luck

  3. #3
    Addicted Member
    Join Date
    Jan 2000
    Location
    Fresno, California, USA
    Posts
    195

    Post

    You could try the following:

    dim pDefault as Printer
    dim pPrinter as printer
    dim PrinterName as string

    ' Save the original default
    set pDefault = Printer
    ' Tell it what to look for
    PrinterName = "Name of the printer you want"
    ' Set the new default
    For Each pPrinter In Printers
    If pPrinter.DeviceName = PrinterName Then
    Set Printer = pPrinter
    End If
    Next
    ' Restore the old default
    set Printer = pDefault

  4. #4

    Thread Starter
    Member
    Join Date
    Jan 2000
    Location
    Lisbon, Portugal
    Posts
    55

    Post

    Originally posted by HDR:
    You could try the following:

    dim pDefault as Printer
    dim pPrinter as printer
    dim PrinterName as string

    ' Save the original default
    set pDefault = Printer
    ' Tell it what to look for
    PrinterName = "Name of the printer you want"
    ' Set the new default
    For Each pPrinter In Printers
    If pPrinter.DeviceName = PrinterName Then
    Set Printer = pPrinter
    End If
    Next
    ' Restore the old default
    set Printer = pDefault
    Thanks, but I need to set the system default printer.
    With your code I set the default printer for my application. :-)

    Thanks anyway
    If you know any way to help me thanks


Posting Permissions

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



Click Here to Expand Forum to Full Width