I wanna print a bunch of stuff.
Do you have any tutorials/code???
Printable View
I wanna print a bunch of stuff.
Do you have any tutorials/code???
What kind of stuff? From what do you wish to print it?Quote:
Orginally posted by Evan
I wanna print a bunch of stuff.
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.
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.
Can I have an example???
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.
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.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.VB Code:
Private Sub Form_Load() Dim lpobj As OLEObject Dim szfilename As String szfilename = "c:\sys\winemu\ibmloglo.bmp" ' put some valid file name here Set lpobj = RichTextBox1.OLEObjects.Add(, , szfilename) lpobj.DisplayType = rtfDisplayContent ' if you un comment the following line you will go to edit mode: 'lpobj.DoVerb Set lpobj = Nothing 'add text End Sub Private Sub cmdPrint_Click() Call RichTextBox1.SelPrint(Printer.hDC) End Sub
woaha. Thanks. Ill try that tomarrow mornin =)