PDA

View Full Version : How to delete all lower case words



DanMan
01-26-2023, 05:08 PM
How can I delete all lower case words in an MS Word doc? Meaning all words that begin with a lower case letter.Thank you?

Logit
01-26-2023, 08:26 PM
Untested here ... change UPPER CASE letters to lower case and apply ...

https://superuser.com/questions/1576615/delete-all-uppercase-paragraphs-using-find-replace

SamT
01-26-2023, 09:05 PM
I don;t know the correct VBA for Word terminology, but basically

For Each Word in AllWords
If Word = LCase(Word) Then Word.Delete
End If

gmayor
01-26-2023, 10:10 PM
Use a wildcard search for
<[a-z]{1,}>
replace with nothing

DanMan
01-27-2023, 09:57 AM
Thank you all! A few comments in case others read this:
1) I had seen that before but couldn't get it to work. One needs to check the "Use Wildcards" box for this to work
2) It doesn't work for contractions, words like "isn't" and "weren't" Is there a simple mod to the line above that would also cover words like that or words with special characters?"

gmayor
01-27-2023, 10:21 PM
You can add the character you want e.g.

<[a-z']{1,}>

See https://www.gmayor.com/replace_using_wildcards.htm

Aussiebear
01-27-2023, 10:48 PM
Sorry to butt in here Graham but, as I understand your suggestion <[a-z'] {1,}>, will find all lower case letters within the range a to z and the apostrophe, and replace them with nothing. Will this not also find the lower case letters of a word starting with an Upper case?