VB-AN-IZ
01-25-2018, 03:28 PM
How would I find any lower-case letters at the start of a paragraph and capitalise them?
For example, turning this:
where it began, I can't begin to knowing
but then I know it's growing strong
was in the spring
then spring became the summer
who'd have believed you'd come along
...into this:
Where it began, I can't begin to knowing
But then I know it's growing strong
Was in the spring
Then spring became the summer
Who'd have believed you'd come along
Without a macro, you can find ^13[a-z] (wildcards on) and select Find In > Main Document, then select UPPERCASE from the Font > Change Case area. Recording that created this macro, which is not replicable:
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^13[a-z]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Range.Case = wdUpperCase
End Sub
I suspect the solution begins with this but then I get lost...
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
Do While .Execute(findtext:="^13[a-z]", MatchWildcards:=True)
Thanks for any help!
For example, turning this:
where it began, I can't begin to knowing
but then I know it's growing strong
was in the spring
then spring became the summer
who'd have believed you'd come along
...into this:
Where it began, I can't begin to knowing
But then I know it's growing strong
Was in the spring
Then spring became the summer
Who'd have believed you'd come along
Without a macro, you can find ^13[a-z] (wildcards on) and select Find In > Main Document, then select UPPERCASE from the Font > Change Case area. Recording that created this macro, which is not replicable:
Selection.Find.ClearFormatting
With Selection.Find
.Text = "^13[a-z]"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchAllWordForms = False
.MatchSoundsLike = False
.MatchWildcards = True
End With
Selection.Range.Case = wdUpperCase
End Sub
I suspect the solution begins with this but then I get lost...
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng.Find
Do While .Execute(findtext:="^13[a-z]", MatchWildcards:=True)
Thanks for any help!