Input is:
Heading1
Heading 2
Heading 3
This is the body part.
Output should be
Heading 1
Added body text
Heading 2
Added body text
Heading 3
This is the body part.
I have used the following code but not working
Sub Test4()
Dim i As Integer
i = ActiveDocument.Sentences.Count
For P = 1 To i
ptext = ActiveDocument.Sentences(P).Text
If ActiveDocument.Sentences(P).Style = "Heading 1" Then
If ActiveDocument.Sentences(P + 1).Style = "Heading 1" Then
'Selection.InsertParagraph
Selection.Start = ActiveDocument.Sentences(P).End
Selection.InsertAfter "body" & vbCrLf
Selection.Style = wdStyleNormal
Selection.Start = ActiveDocument.Sentences(P + 1).End
i = i + 1
End If
End If
Next
End Sub