Results 1 to 2 of 2

Thread: Default Printer

  1. #1

    Thread Starter
    Registered User
    Join Date
    Nov 2002
    Posts
    12

    Default Printer

    Hi Guy's,

    how do i change my default printer temporary to print a document and change back when I exit my visual basic application
    thank you

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    VB Code:
    1. ' This piece of code changes the printer dynamically and only changes the printer for that application. So the actual default printer for the system remains unaffected.
    2.  
    3. Dim lobjPrinter As Printer
    4.  
    5. For Each lobjPrinter In Printers
    6. If UCase(Trim("Some Printer Name")) = UCase(Trim(lobjPrinter.DeviceName)) Then
    7. Set Printer = lobjPrinter
    8. Exit For
    9. End If
    10. Next
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

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