On 5 Jun 1997 22:48:32 GMT, "Graeme Mahoney" wrote:
>I'd like to print out text so say 20 characters max, when textbox contents
>is maybe 100 long.
Yes it's possible. I have a proc which will
do it for you but you can only use it with a certain
font and size. (Your user cannot choose another font/size because of the way the proc works). I
made it in VB3, use it now in VB 4. Perhaps there is another way (must be) but it still works for me...
'maximum characters printed
Const lengte_omschrijving% = 40
sub Afbreken(wat$, waar%)
dim lcounter%, deel1$, lteller%
lcounter = 1
do While lcounter < Len(wat$)
deel1 = Mid$(wat$, lcounter, lengte_omschrijving)
If lcounter + Len(deel1) < Len(wat$) Then
For lteller = Len(deel1) To 1 Step -1
If Mid$(deel1, lteller, 1) = Chr(32) Then
Printer.Print Mid$(wat$, lcounter, lteller)
lcounter = lcounter + lteller
lteller = 1
lcounter = Len(wat$)
'this will give you the contents of text1 printed with a left margin of 10 charachters and a length of 40; if necessary it's wrapped around a space.