Results 1 to 3 of 3

Thread: Printing Help?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    UK
    Posts
    204

    Question Printing Help?

    Hi,

    How can i using a commondialog control ask the user what printer they want to use and how many copies etc, and then print all the text in a text box to that printer??

    Many thanks!


  2. #2
    Junior Member
    Join Date
    Apr 2002
    Location
    Michigan
    Posts
    27

    Smile hope this helps

    after you put the dlgprint on your form put a command button on your form with the followong code. hope this helps you out, not sure if its what you wanted.

    VB Code:
    1. Private Sub Command8_Click()
    2. dlgprint.CancelError = True
    3.   On Error GoTo ErrHandler
    4.        dlgprint.ShowPrinter ' the following sets properties
    5.        Printer.Print
    6.        Printer.ScaleMode = 5
    7.        Printer.CurrentX = 1
    8.        Printer.CurrentY = 1
    9.        Printer.Font = "Arial"
    10.        Printer.FontSize = 8
    11.        Printer.Font.Bold = False
    12.        Printer.Font.Italic = False
    13. Dim old_width As Integer
    14.    Printer.Print Tab(5):text1.text  'starts print in from the edge 5 spaces then prints contents of text1.
    15.    Printer.Print ""         'creates a blank line
    16.    Printer.Print Tab(7); text2.text ' prints 7 spaces from last print text2 contents
    17. Printer.EndDoc
    18.     ErrHandler:
    19.     Exit Sub
    20. End Sub
    Rj

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2001
    Location
    UK
    Posts
    204
    Thanks rjcarroll!!

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