View Single Post
 
Old 03-18-2022, 07:41 PM
balavaka balavaka is offline Windows 10 Office 2013
Novice
 
Join Date: May 2021
Posts: 25
balavaka is on a distinguished road
Default need some change in this

I need to find and change only on paragraphs which tag contains like at start (e.g. <S1>, <S2>, <S3>)


Sub TitleCase()
Dim lclist As String
Dim wrd As Integer
Dim sTest As String

' list of lowercase words, surrounded by spaces
lclist = " of the by to this is from a and in with on for through are they via at an as "

Selection.Range.Case = wdTitleWord

For wrd = 2 To Selection.Range.Words.Count
sTest = Trim(Selection.Range.Words(wrd))
sTest = " " & LCase(sTest) & " "
If InStr(lclist, sTest) Then
Selection.Range.Words(wrd).Case = wdLowerCase
End If
Next wrd
End Sub
Attached Files
File Type: docx Before and After Change.docx (11.9 KB, 7 views)
Reply With Quote