![]() |
|
#2
|
||||
|
||||
|
Hi Sdoneti,
Try something like the following, which shows how you can get the next word, or even the whole paragraph: Code:
Sub Demo()
With Selection.Range
With .Find
.ClearFormatting
.Text = "Heading"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindStop
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute
End With
Do While .Find.Found
' get the next word
MsgBox .Words.Last.Next.Words.First
' get the whole paragraph
MsgBox .Paragraphs.Last.Range.Text
.Collapse wdCollapseEnd
.Find.Execute
Loop
End With
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Lost Word Document and cant find it!!! I saved it but it ISNT there!!
|
APAV | Word | 9 | 10-09-2017 01:17 PM |
| How to find out the version of the word files? | mariaprabudass | Word | 0 | 06-18-2010 05:40 AM |
can Find/Replace NOT find something?
|
Bobosmite | Word | 6 | 05-27-2010 08:09 PM |
| How to find the version of word file? | mariaprabudass | Word | 6 | 04-29-2010 03:33 AM |
| FInd recurring words in Word 2003 | NJ007 | Word | 4 | 01-25-2010 03:11 PM |