Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
wildetudor wildetudor is offline
external usenet poster
 
Posts: 57
Default Logical OR in Word wildcard searches

Hey everyone,

I'm in a situation where I need to search for text in my document with words
that have several possible alternatives - and for that I need to use a
logical OR between them. If I'd used a Google search syntax for example, it
would have been easy - e.g. "having a headache OR migraine", but in Word I
don't know how to do it, and could not find anything about this in the Word
Help.

Can anyone advise me how to do this? Anticipated thanks!
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Tony Jollans Tony Jollans is offline
external usenet poster
 
Posts: 1,308
Default Logical OR in Word wildcard searches

Sorry, you can't do that with a single Find operation in Word. You will need
to do multiple Finds but you can automate the operation to a certain extent
with VBA if you want.

--
Enjoy,
Tony

www.WordArticles.com

"wildetudor" wrote in message
...
Hey everyone,

I'm in a situation where I need to search for text in my document with
words
that have several possible alternatives - and for that I need to use a
logical OR between them. If I'd used a Google search syntax for example,
it
would have been easy - e.g. "having a headache OR migraine", but in Word I
don't know how to do it, and could not find anything about this in the
Word
Help.

Can anyone advise me how to do this? Anticipated thanks!


  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Greg Maxey[_2_] Greg Maxey[_2_] is offline
external usenet poster
 
Posts: 668
Default Logical OR in Word wildcard searches

As previously posted there isn't really a method of using OR in Word Find
and Replace routines. You can use a bit of VBA brute force to the same
effect:

Sub HelmutsDilemma()
Dim aWord As Range
Dim pLast As String
For Each aWord In ActiveDocument.Range.Words
If aWord.Characters.Last = " " Then
pLast = " "
Else
pLast = ""
End If
Select Case Trim(aWord.Text)
Case Is = "headache", "migraine"
aWord = "sore head" & pLast
Case Else
'Do Nothing
End Select
Next
End Sub


wildetudor wrote:
Hey everyone,

I'm in a situation where I need to search for text in my document
with words that have several possible alternatives - and for that I
need to use a logical OR between them. If I'd used a Google search
syntax for example, it would have been easy - e.g. "having a headache
OR migraine", but in Word I don't know how to do it, and could not
find anything about this in the Word Help.

Can anyone advise me how to do this? Anticipated thanks!


--
Greg Maxey - Word MVP

My web site http://gregmaxey.mvps.org
Word MVP web site http://word.mvps.org



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wildcard file searches PA New Users 1 July 12th 06 01:09 PM
Mailmerge, querystring and (un)logical SQL (Word 2003) FP Mailmerge 14 June 30th 06 03:33 PM
In WORD its more logical to have PAPER as First Tab in Page Setup Asoka Walpitagama - Brandix College IT Page Layout 2 May 5th 06 03:14 PM
Is there a way to specify Logical Operators (ROP3) values in Word? Don Microsoft Word Help 1 July 11th 05 08:10 PM
word searches for printer Mark B Microsoft Word Help 3 February 21st 05 05:27 PM


All times are GMT +1. The time now is 09:43 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"