![]() |
|
|
|
#1
|
|||
|
|||
|
I'm trying to establish a new range after finding a string, so that I can use Find again from the Found point to the end of the document. But the tentative code here below doesn't work. Can someone help? Thanks!
Code:
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = "Title"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.Execute
End With
'Here I need to fix the starting point of a new Find, but it doesn't work
oRng.Start = oRng.Find.Found
oRng.End = ActiveDocument.Range.End
With oRng.Start.Find
.Text:="Section"
.Execute
End With
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Subscript out of Range Error when searched for string and its line number in Text File | SamDsouza | Word VBA | 4 | 01-12-2021 07:08 PM |
Wildcard replace any string in context with a specified string
|
wardw | Word | 7 | 05-07-2018 09:13 AM |
How to Import range between two string from other document
|
PRA007 | Word VBA | 1 | 12-18-2015 09:23 PM |
finding a string containing a combination of formats and adding text before
|
Marco | Word VBA | 1 | 11-02-2015 05:08 PM |
Way to search for a string in text file, pull out everything until another string?
|
omahadivision | Excel Programming | 12 | 11-23-2013 12:10 PM |