![]() |
|
#1
|
|||
|
|||
|
I found this macro on Allen Wyatt's Wordtips site. I have a multi-hundred-page document coming through soon, in which I would like to lower-case a list of words improperly capitalized. This macro handles only a single word, but takes care of instances in which the word begins a sentence; I have used the word "video". What adjustment would I need to enter more than one such term, to obviate having to make multiple single-word passes?
Is it also possible to exclude MS's built-in heading styles from the replacement, since the words would be properly capitalized there? Thank you. Code:
Sub ChangeCase2()
With Selection.Find
.ClearFormatting
.Wrap = wdFindContinue
.Forward = True
.Format = True
.MatchCase = False
.MatchWildcards = False
.Text = "video"
.Execute
While .Found
Selection.Range.Case = wdLowerCase
Selection.Range.Case = wdTitleSentence
Selection.Collapse Direction:=wdCollapseEnd
.Execute
Wend
End With
End Sub
|
| Tags |
| search and replace |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
VBA code to compile one document based on multiple search terms
|
Hoxton118 | Word VBA | 4 | 04-04-2021 06:02 AM |
Best Practice for Indexing Multiple Word Terms and Sub-Terms
|
jhy001 | Word | 4 | 11-06-2017 02:08 PM |
| Macro on Search and Replace | davidhuy | Word VBA | 1 | 12-19-2014 04:47 AM |
| Onenote 2013 search is not identifying search terms correctly | Delta223 | OneNote | 0 | 08-12-2014 06:40 AM |
| How do I search for terms in initial upper-case? | bertietheblue | Word | 5 | 05-02-2012 05:24 AM |