![]() |
|
#1
|
|||
|
|||
|
Is there a macro that will allow me to search a Word document for any instances where the same word (including singular/plural number agreement and initial case) is immediately repeated without separation by punctuation, eg:
"the the" "services services" but not: "the, the" "services Service" ? Many thanks. |
|
#2
|
||||
|
||||
|
You don't really need a macro. Do a wildcard search for
(<[a-zA-Z]{2,}>) \1 replace with \1 http://www.gmayor.com/replace_using_wildcards.htm
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#3
|
|||
|
|||
|
Thanks a lot, this is great! But is an adjustment possible to make the wild-card search whole-word-only? For example, it picks up:
"or oral" "or order" but I just want it to pick up instances of "or or" |
|
#4
|
||||
|
||||
|
Use a wildcard Find/Replace with:
Find = (<[A-Za-z]@>) <\1> Replace = \1
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#5
|
|||
|
|||
|
Magic! Thanks
|
|
#6
|
||||
|
||||
|
The spelling and grammar check can reveal doubled instances like that. There's an option to choose for repeated words.
|
|
#7
|
||||
|
||||
|
Yes, but it does so on a case-by case basis; the Find/Replace does the lot in one go.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How do I delete the names under "Exceptions" when I use the "Restrict Editing" feature in Word? | MengS | Word | 0 | 02-25-2015 02:57 PM |
Word 2011 Mac: autoconvert "2015" to "two thousand and fifteen?"
|
moonman239 | Word | 3 | 02-06-2015 12:22 PM |
| can find and replace instances of the "enter" key? | snunicycler | Word | 7 | 05-02-2013 11:54 PM |
Word options "field shading" reverts to "when selected"
|
PaulBurcham | Word | 1 | 04-20-2013 11:18 AM |
| 'Linking' entered information to other "cells" from an original "cell" in MS Word | Wade | Word | 6 | 09-03-2012 05:22 PM |