Printing Text

truc0011
truc0011 used Ask the Experts™
on
I have a text box that is read into the program as a string, but when I go to send it to the printer the text runs off the box instead of staying in it.  How do I make it stay in the box?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
hi truc0011,
 You could use the Print method. For example:
 
 Printer.Print "Sample print"

 In your case try:

 Printer.Print text1.text  'Your text box

 I hope it helps.

 Goodluck,
 Lynger

Commented:
try this

Printer.print  text1.text
Printer.EndDoc  ' tell the printer it is the end of doc
and start print


I hope it helps.

Avis

Commented:
dim strText as string

strText = text1.text

printer.print strText
printer.enddoc

hope this will help you


bye
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
Yeah these will print the text but it is still outside of the box!

If I type text and hit enter at the end of every line then it stays in the box, else it goes outside!

Commented:
Set the text properties "MultipleLine" to True and also set the "Scrollbars" to either "vertical" or both.

Author

Commented:
Multiple line is true!

Commented:
Strange!Strange! Let me repeat what your proposal is:

You have a form with a text box, assume the text box is set to multipleline=True, Scrollbars=Vertical, once you type something in the text box and click a button which is used to call print function.

How come the text gets off the text box. Maybe in someplace you set the textbox.text to empty after printing???

Author

Commented:
when typing the text wraps, then the text is read into a string variable, printing that does not wrap. I think I figured it out though, thanks!!!

Author

Commented:
led me in the right direction!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial