Even if I delete unnecessary code and add number of paragraph, it still working the same: It is doing what I want to do with document but still with error: object variable or with block variable not set
Sub add_sign_xml()
Dim oPar As Paragraph
For Each oPar In ActiveDocument.Range.Paragraphs
If oPar.Range.Characters.First = "<" _
And Not InStrRev(oPar.Range.Text, "-") > 0 _
And Not InStr(oPar.Next(1).Range.Text, "<tr>") > 0 Then 'I've added no. of paragraph
oPar.Range.InsertAfter "add"
End If
Next
End Sub