0
votes

I have a few textboxes in a slide. Each of them have different font sizes.

The text in the textbox are multi-line. But their line-breaks are word-wrapped, not manual carriage returned.

I need to convert those word-wrapped text to proper carriage-returned text, so i can export it to a CSV text file.

I have many Powerpoint presentation files, with hundreds of slides in each file. And each slide a few wordwrapped textboxes with different font sizes.

How should i solve this problem?

Hope someone can point me to the right direction. Thanks!

1

1 Answers

0
votes

Here's something to get you started:

Sub TestIt()
    Dim osh As Shape
    Set osh = ActiveWindow.Selection.ShapeRange(1)
    Call WordwrapToLineEnd(osh)
End Sub

Function WordwrapToLineEnd(osh As Shape)

    Dim x As Long

    With osh.TextFrame.TextRange
        For x = 1 To .Lines.Count
            .Lines(x).Text = .Lines(x).Text & vbCrLf
        Next
    End With

End Function