Results 1 to 8 of 8

Thread: Printing??

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517

    Printing??

    I wanna print a bunch of stuff.
    Do you have any tutorials/code???

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Orginally posted by Evan
    I wanna print a bunch of stuff.
    What kind of stuff? From what do you wish to print it?

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    I wish to print a bunch of items from a text box in a semi arranged order. With a image of the companys logo at the top.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    If you want them in a specific order, then place them in that order in the text box. Standard text boxes do not offer a lot of flexibilty. Also, standard text boxes don't support bitmaps and such, so you can forget about your company logo unless you have logo paper loaded in the printer.

    Moving from a stanard text box to a Richtextbox would give you more flexibility, and Richtextboxes do allow you to insert pictures, icons, bitmaps, etc. although it, too, will print its contents in the order in which the items are stored.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    Can I have an example???

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Ok. I don't use pictures in Richtextboxes all that much, so I don't have an immediate example. Let me whip something up for you.

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Whew...this was more interesting than I thought it would be. Substitute the path and bitmap name in this piece of code for a bitmap that you have on your machine somewhere. The rest should work.
    VB Code:
    1. Private Sub Form_Load()
    2.     Dim lpobj As OLEObject
    3.     Dim szfilename As String
    4.     szfilename = "c:\sys\winemu\ibmloglo.bmp" ' put some valid file name here
    5.     Set lpobj = RichTextBox1.OLEObjects.Add(, , szfilename)
    6.     lpobj.DisplayType = rtfDisplayContent
    7.     ' if you un comment the following line you will go to edit mode:
    8.     'lpobj.DoVerb
    9.     Set lpobj = Nothing
    10.     'add text
    11. End Sub
    12.  
    13. Private Sub cmdPrint_Click()
    14.      Call RichTextBox1.SelPrint(Printer.hDC)
    15. End Sub
    You will probably want to play around with this quite a bit until it does whatever you need it to do, but I hope I have at least given you a starting point.

  8. #8

    Thread Starter
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517
    woaha. Thanks. Ill try that tomarrow mornin =)

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