Long text within a textframe

Japis
06-12-2008, 04:51 AM
Hi,

I'm trying to automate the generation of invoices for my company. A tricky part is that, depending on the payment terms option selected, a text must appear, describing the conditions, in a corner of the invoice.

This text can be up to 2000 characters long.

So far I've been trying to create a textframe, but it loks to me like there's some sort of length limit to the text it can contain, and have not been able to figure out how to extend it (if possible)

Can someone suggest how to get a long text inside a textframe, or a workaround for this?


Thanks!

Japis

Colin Legg
06-12-2008, 05:21 AM
Hi Japis,

I tested the workaround here (http://www.ozgrid.com/forum/showthread.php?t=77662) and it seems to be okay:


Sub foo()
Dim myDocument As Worksheet
Dim myString As String, i As Integer

myString = String(2000, "a")

Set myDocument = Worksheets(1)
With myDocument.Shapes.AddShape(msoShapeRectangle, _
0, 0, 250, 140).TextFrame

.Characters.Text = ""
For i = 0 To Int(Len(myString) / 255)
.Characters(.Characters.Count + 1).Text = Mid(myString, 255 * i + 1, 255)
Next

End With

End Sub

Japis
06-12-2008, 06:35 AM
Wow, quick and effective!

Thanks very much!

Japis

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum