line breaks in (auto)shapes
my problem is the following, my code generates shapes (msoshape...) in excel on the fly. problem occurs when i insert the text into the shapes using
shape.textframe.characters.text = str
when I try to insert a line break VbCr I get a | in the field instead of a cr, using VbCrLf gives a line break but also inserts a | at the end of the previous line. since there is no multiline property to be set on a shape object i'm stuck .... any ideas ?
Last edited by wiegels; May 15th, 2003 at 02:51 AM.
June 26th, 2003, 01:20 PM
Use Chr(10) like so:
my_Shape.TextFrame.Characters.Text = "Line 1" & Chr(10) & "Line 2"
June 26th, 2003, 01:46 PM
You have three constants
VbCr <-- carriage return
VbLf <-- Line feed
VbCrLf <-- carriage return & line feed
Try using VbLf (which is just another way of saying Chr(10) )