Hi Lien, crossover grid
You can add comment to that paragraphs following this code:
Sub Highlight_And_AddComment()
Dim oRng As Range
Dim oDoc As Document
Dim oPara As Paragraph
Dim oComment As Comment
Set oDoc = ActiveDocument
' Initialize the range to the start of the document
Set oRng = oDoc.Range
oRng.Collapse wdCollapseStart
' Loop through the document to find and highlight the text
Do While oRng.Find.Execute(FindText:="HAPPY")
' Highlight the entire paragraph in yellow
oRng.Paragraphs(1).Range.HighlightColorIndex = wdYellow
' Add a comment to the paragraph
Set oPara = oRng.Paragraphs(1)
Set oComment = oPara.Range.Comments.Add(Range:=oPara.Range, Text:="This paragraph contains the word 'HAPPY'")
' Move to the end of the document to continue searching
oRng.Collapse wdCollapseEnd
Loop
End Sub
Remember to replace "This paragraph contains the word 'HAPPY'" in the `Text` property of the `Comments.Add` method with your desired comment text.