Re: VBA and regular expression to search for ranges of text
- From: Helmut Weber <red.sys@xxxxxxxxxxx>
- Date: Mon, 27 Jun 2005 17:07:38 +0200
Hi Enda,
lke this:
Sub Test7884()
Dim rTmp As Range
Set rTmp = ActiveDocument.Range
ResetSearch
With rTmp.Find
.Text = "\\begin\{figure\}*\\end\{figure\}"
.MatchWildcards = True
While .Execute
rTmp.Select ' for testing
Wend
ResetSearch
End With
End Sub
' ----
Public Sub ResetSearch()
With Selection.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
' plus some more if needed
.Execute
End With
End Sub
You don't have to convert what you found to a range.
It is a range already. The question is, what do want to do with it.
Greetings from Bavaria, Germany
Helmut Weber, MVP, WordVBA
Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
.
- Follow-Ups:
- Re: VBA and regular expression to search for ranges of text
- From: enda_ridge
- Re: VBA and regular expression to search for ranges of text
- References:
- VBA and regular expression to search for ranges of text
- From: enda_ridge
- VBA and regular expression to search for ranges of text
- Prev by Date: Re: What is the VBA for protecting a document
- Next by Date: Re: Anyone have issues....
- Previous by thread: VBA and regular expression to search for ranges of text
- Next by thread: Re: VBA and regular expression to search for ranges of text
- Index(es):
Relevant Pages
|