hello! everybody:
I encountered another problem.
I want to find a word together with the words coming after or before of this word.
For example.
I am learning visual basic programming in my university.
I want to find 'basic'the first time .next
find 'visual basic programming '
next time 'learning visual basic programming in '
...........
I tried the following code:but I only find the following words of 'basic'
could not find together the words coming before and after.
[VBA] Dim rngReplace As Word.Range
Dim rngFound As Word.Range
Set rngReplace = ActiveDocument.Content
With rngReplace.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "<basic>&<*>"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
' Find all in the document
'Do While .Execute
'but I only find the following words of 'basic'could not find together the words 'coming before and after.
[/VBA]
I need your kindly help.