So, I've plagiarized this code:
http://www.msofficeforums.com/word-v...html#post48397
It highlights any text between:
Split("
", ",")
...as long as there are no spaces between each comma.
Sub ListChange()
Dim r As Range
Dim MyList() As String
Dim i As Long
MyList = Split("dot,com,like", ",")
For i = 0 To UBound(MyList())
Set r = ActiveDocument.Range
With r.Find
.Text = MyList(i)
.Replacement.Highlight = wdYellow
.Execute Replace:=wdReplaceAll
End With
Next
End Sub
Is there a way to modify this code – or, I guess, create an entirely new one – which highlights the entire paragraph containing specific text?
For example, in this text:
You can do anything, but not everything.
Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
The richest man is not he who has the most, but he who needs the least.
You miss 100% of the shots you never take.
...could I search for the text "richest" and highlight the entire third paragraph?
I really have no idea how to specify "up to last and next paragraph" without getting into trouble...
Thanks for any help!