Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
![]()
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 | |
|
|
![]() |
||||
Thread | Forum | |||
Wildcard file searches | New Users | |||
Mailmerge, querystring and (un)logical SQL (Word 2003) | Mailmerge | |||
In WORD its more logical to have PAPER as First Tab in Page Setup | Page Layout | |||
Is there a way to specify Logical Operators (ROP3) values in Word? | Microsoft Word Help | |||
word searches for printer | Microsoft Word Help |