Consulting

Results 1 to 14 of 14

Thread: How to highlight paragraphs and add comment

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1

    How to highlight paragraphs and add comment

    I have macro to find text then highlight paragraphs having it.
    Now i want to add comment to that paragraphs. But dont know how.
    Can anyone suggest.

    Here is code for Highlight

    Sub Highlight_WordN()
    Dim oRng As Range
    Set oRng = ActiveDocument.Range
    With oRng.Find
       Do While .Execute(FindText:="HAPPY")
       oRng.Paragraphs(1).Range.HighlightColorIndex = wdYellow
       oRng.Collapse 0
       Loop
    End With
    lbl_Exit:
    Set oRng = Nothing
    Exit Sub
    End Sub
    Thank you.
    Lien
    Last edited by Aussiebear; 04-11-2023 at 04:58 AM. Reason: Added code tags to supplied code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •