Formatting a text box for printing(please help!!!) 
Author Message
 Formatting a text box for printing(please help!!!)

hey all,
I am working on a prog that requires me to format the output to the printer
when the text is taken from a text box. If i just say--- Printer.print txtNotes
it just prints one line and doesnt print the whole text box. I was just curious
if there is some sort of word wrap type function or some code structure to
print more than just one line. Any help would be great.
Thanks,
Matterhorn


Tue, 19 Apr 2005 09:17:04 GMT  
 Formatting a text box for printing(please help!!!)


Quote:
>I am working on a prog that requires me to format the output to the printer
>when the text is taken from a text box. If i just say--- Printer.print txtNotes
>it just prints one line and doesnt print the whole text box. I was just curious
>if there is some sort of word wrap type function or some code structure to
>print more than just one line. Any help would be great.

Hi Matterhorn. Not sure what causes your prob.

In VB6, SP5, Win98 I ran:-

Private Sub Form_Load()

    For i = 1 To 5
        Text1.Text = Text1.Text & vbCrLf & i
    Next i

    Printer.Print Text1.Text

End Sub

The printed o/p included all of Text1's text :-

Text1
1
2
3
4
5

Apologies for a non-answer to your question :-)

Regards.

--
Martin Trump



Tue, 19 Apr 2005 09:41:27 GMT  
 Formatting a text box for printing(please help!!!)
When you use the Printer.Print method to print some text it prints the entire text string on one line, so that anything longer than the width of the page will not be printed. In order to print an entire text box contents, or a long string of text, you need to write a bit of code. A lot depends on what you want to do, so it really isn't worth giving you an example until you post again with your requirements. For example, do you want to print the text exactly as it is displayed in the text box (line for line) or do you want to print it so that it wraps to the page, or to a specified rectangle on the page, or do you want it in columns, and what sort of justification do you want (left, right, centre, full, force, wrap around an object etc), all sorts of possibilities. Just about the simplest way of doing it (if you do not require "full justification") is to use the DrawText API, which will enable you to do it in a "one liner". Alternatively, you can write code to print your text in any way you desire. Post again with more details of your requirements.

Mike

Quote:

> hey all,
> I am working on a prog that requires me to format the output to the printer
> when the text is taken from a text box. If i just say--- Printer.print txtNotes
> it just prints one line and doesnt print the whole text box. I was just curious
> if there is some sort of word wrap type function or some code structure to
> print more than just one line. Any help would be great.
> Thanks,
> Matterhorn



Tue, 19 Apr 2005 18:37:59 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. help: formatting rich text box/text box

2. Please help: Formatting text box

3. Printing a Text Box with wordwrap - HELP, please!

4. Setting printing margins for rich text box - please help

5. ATTN: Mike Formatting a text box for printing(Updated)

6. Formatting Data in a text box for printing

7. Printing formatted rich text box

8. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

9. Help: Printing text contained within the Rich Text box

10. how do you make text goto the next line in a text box,please help

11. Wordwrap the text line in a text box, please help

12. Help: Trouble printing text box with lots of text

 

 
Powered by phpBB® Forum Software