A
avkokin
Hello.
I need to convert first letter of every word "you" and "your" in
string to uppercase ("You" and "Your"). I wrote example of code, but
it converts all entries even into composition of words (e.g. "young").
What I should change in my code? This code is below.
Thank you.
-----------------
Sub firstLetter()
Dim aLett(3) As String
aLett(0) = "you"
aLett(1) = "your"
For ms = 0 To 1
With Selection.Find
..ClearFormatting
..Replacement.ClearFormatting
..Text = aLett(ms)
..Replacement.Text = StrConv(aLett(ms), vbProperCase)
..Forward = True
..MatchCase = True
..Wrap = wdFindContinue
..Format = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Next ms
End Sub
I need to convert first letter of every word "you" and "your" in
string to uppercase ("You" and "Your"). I wrote example of code, but
it converts all entries even into composition of words (e.g. "young").
What I should change in my code? This code is below.
Thank you.
-----------------
Sub firstLetter()
Dim aLett(3) As String
aLett(0) = "you"
aLett(1) = "your"
For ms = 0 To 1
With Selection.Find
..ClearFormatting
..Replacement.ClearFormatting
..Text = aLett(ms)
..Replacement.Text = StrConv(aLett(ms), vbProperCase)
..Forward = True
..MatchCase = True
..Wrap = wdFindContinue
..Format = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Next ms
End Sub