Hullo,
I'm using a range's Find.execute to loop through all the matchs of a word in a document. What I want to do is retrieve the sentence, or if this isn't possible the line or paragraph, that surronds the matched word. So if I'm searching for 'chips' in a document, and it occurs in the sentence 'I like Fish and Chips.', then I want the string 'I like Fish and Chips'.
All help gratefully received - many thanks for your help!
[vba]
Set rngDoc = ActiveDocument.Content
While blContinue
rngDoc.Find.Execute strSearchWord, False, True
If rngDoc.Find.Found = True Then
'Code to get sentence goes in here
intCount = intCount + 1
blContinue = True
Else
blContinue = False
End If
Wend
[/vba]