So my logic is to have a button the when pressed will loop through each character and place a carriage return. Ive add the returns but the only happen at the end not after each character.
Dim txt As String, s As Shape, i as integer
If s.Type = cdrTextShape Then
txt = ActiveShape.Text.Story.Text
' go through each character in the text (t) For i = 1 To Len(txt) ActiveShape.Text.Story.InsertAfter (Chr(13)) Next i End If
You can try following code
Sub test()Dim txt As String, s As Shape, i As IntegerSet s = ActiveShapeIf s.Type = cdrTextShape Thentxt = ActiveShape.Text.Story.TextFor i = 0 To Len(txt) - 2s.Text.Story.Characters.Item(i + i + 1).InsertAfter (Chr(13))Next iEnd IfEnd Sub
Best regards
Mek
Variable “i” starts from 0 instead 1 to insert CR after position 1.
2 is subtracted to avoid inserting second CR after last character as there is CR originally.