Hi, a following code not working when at begin of paragraph occurs hypen, how to solve this.
File to testing: insertafter.docx


Sub add_before_xml()
          
    Dim bRng As Range
    Set bRng = ActiveDocument.Range
    With bRng.Find
        
                
                 With .Font
                    .Size = 8
                    .Underline = wdUnderlineSingle
                End With
          
        Do While .Execute(MatchWholeWord:=True)
       
                
         bRng.End = bRng.Paragraphs(1).Range.End - 1
             With bRng
                .InsertBefore "<tr><td>"
                .InsertAfter "</td></tr>"
                .Collapse 0
            End With
         
        Loop
    End With
lblb_Exit:
    Set bRng = Nothing

End Sub