Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I want to print (to a printer) the 2

Status
Not open for further replies.

BadCook

Technical User
Sep 7, 2009
71
US
I want to print (to a printer) the contents of a RichTextBox.
The follwing code recievs the command and prints, but only when I shut the program down ???

Private Sub Command5_click()
Printer.Print RichTextBox1(38).text
End Sub

How can I get it to print immediately ?
 
Adding "Prnter.End Document" causes a "Vriable Not Defind" error, highling Document
 
How about:
[tt]
Private Sub Command5_click()
Printer.Print RichTextBox1(38).text
Printer.EndDoc
End Sub
[/tt]
Like Hugh suggested...

Have fun.

---- Andy
 
Of course that way you only get the text, rather than all the layout and formatting you might have carefully applied. If you want it as you see it, then

Richtextbox(38).SelPrint

might be a better option (and sends StartDoc and EndDoc by default)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top