I'm trying to select text and add some labels at the start/end, and do some stuff in each paragraph of the selection, but I don't know why happens this::
Sub TESTBotones()
Dim p As Paragraph, i As Integer, total As Integer, r As Range
Set r = Selection.Range
total = Selection.Paragraphs.Count
For i = 1 To total
Set p = r.Paragraphs(i)
p.Range.Text = "***" & p.Range.Text
Next
r.Text = "((BOTONES))" & Chr(13) & r.Text & Chr(13) & "((/BOTONES))" & Chr(13)
Debug.Print r.Paragraphs.Count
End Sub
As you can see if you exe this macro, in the Debug.print line, the number of paragraphs decrease in 1 after exiting For Loop...WHY??