![]() |
|
|
|
#1
|
|||
|
|||
|
To create a custom dictionary of medical terms, I would like to remove all hyphenated words from a list of about 12,000 terms. I'm new to Word VBA and macros. Would this be possible to do?
If anyone has a macro like this, or could suggest an approach I could learn from, I would appreciate it. pjs |
|
#2
|
||||
|
||||
|
Is each word in its own paragraph or is there spaces between words? Assuming they are paragraphs, a search and replace would do it. You can record this as a macro if you wanted to.
Find: [a-zA-Z]{1,}-[a-zA-Z]{1,}^13 Replace: Nothing <- don't put anything in the replace box Wildcards turned on
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
#3
|
||||
|
||||
|
A morecomprehensive wildcard Find/Replace that accommodates non-breaking hyphens, em-dashes and en-dashes:
Find = <[! ]@[^~^+^=\-]*> Replace = nothing If the words are whole paragraphs, use: Find = ^13[!^13]@[^~^+^=\-]*^13 Replace = ^p
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to delete all but specific words in Microsoft Word document
|
Landhaus416 | Word | 3 | 09-19-2018 03:00 PM |
Using VBA to delete text between two words
|
warddegeest | Word VBA | 1 | 01-12-2018 04:24 AM |
Is there a possibility to remove all the hyphens inside words...?
|
dabbler | Word | 1 | 01-17-2015 04:37 AM |
How to find and delete duplicate words in doc
|
cinvest | Word | 1 | 09-29-2014 08:34 PM |
Mask mode and hyphens
|
cyndor | Word | 6 | 07-25-2012 06:40 AM |