Results 1 to 2 of 2

Thread: I got me a tough one...Printer Device Names

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2000
    Posts
    33
    ok down there is my code. PrintDialog is a sub that calls up the print dialog and grabs all the userinfo from it. I can get everything and set everythign just fine except for the printer name. It is returned as printmode.dmDeviceName and is returned correctly, i just cant seeem to be able to change the printer.devicename to that. If you need more clarification please contanct me!


    On Error Resume Next
    Dim i As Long
    Dim result As String
    PrintDialog
    If printCancel = 0 Then
    Exit Sub
    End If
    Printer.Orientation = printmode.dmOrientation
    Printer.PrintQuality = printmode.dmPrintQuality
    Printer.ColorMode = printmode.dmColor
    Printer.Copies = printmode.dmCopies
    Printer.PaperSize = printmode.dmPaperSize
    Printer.ScaleLeft = -0.5 * 1440
    Printer.ScaleTop = -0.5 * 1440
    Printer.CurrentX = 0
    Printer.CurrentY = 0
    For i = 0 To lstResults.ListCount - 1
    result = i & " " & lstResults.List(i)
    Printer.Print result
    Next
    Printer.EndDoc

  2. #2
    Junior Member
    Join Date
    Jun 2000
    Location
    Manchester, England
    Posts
    28
    You need to declare a Printer object variable and use the Set statement:

    Dim MyPrinter as Printer

    Set MyPrinter = Printer.DeviceName

    This changes the default printer to whatever is contained in Printer.DeviceName then you can change all the properties of the MyPrinter variable to your liking i.e. MyPrinter.Copies = 2 etc.

    Hope this helps.
    Rob
    We watch in reverence as Narcissus is turned to a flower.

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