Iterating through all Paragraphs - Open/Libre Office Macro

Last updated:

This will cycle through all Paragraphs in the current Text and will output the contents of that Paragraph in a Message Box

Sub Teste4
    oEnum = ThisComponent.Text.createEnumeration()
    Do While oEnum.hasMoreElements()
        oPar = oEnum.nextElement()
        If oPar.supportsService("") Then
            MsgBox oPar.getString()
        End If
End Sub

Dialogue & Discussion