Hi, the following code add text after paragraph but on begin of next paragraph e.g.:
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
</Body>
Sub test_xml()
Dim lPar As Paragraph
For Each lPar In ActiveDocument.Range.Paragraphs
If lPar.Range.Font.Bold = True _
And lPar.Range.Font.Size = 9 _
And Len(lPar.Range) > 2 Then
lPar.Range.InsertAfter "</Body>"
End If
Next
End Sub
I want to add text after paragraph end but on the same paragraph:
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. </Body>
I figured out that part of code below work properly but not every time:
lPar.Range.Characters.last.InsertBefore "</Body>"
instead of:
lPar.Range.InsertAfter "</Body>"
Is there straight syntax to solve that problem?