Hello, using wildcards can I search for one word OR another? For
example I would like something like the following to work:
"apple|pear", but I can't seem to find out what the Word wildcard
equivalent of the regular expression symbol "|" is, to mean "OR".

Thanks

Re: Wildcard Search and "OR" by Helmut

Helmut
Wed Aug 17 05:55:00 CDT 2005

Hi Matthew,

>Hello, using wildcards can I search for one word OR another?

No.

Workarounds are possible, depending on the task.


Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Re: Wildcard Search and "OR" by Greg

Greg
Wed Aug 17 07:04:03 CDT 2005

This is more of an AND approach. First you look for "apple" then for
"pears"

Sub Test()
Dim myArray As Variant
Dim i As Long

myArray = Split("pears|apples", "|")

For i = 0 To UBound(myArray)
With ActiveDocument.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Text = myArray(i)
.Replacement.Text = "Your Text Here"
.Execute Replace:=wdReplaceAll
End With
Next
End Sub