
Originally Posted by
June7
I see nothing that inserts a carriage return/line feed.
I doubt Word VBA is case sensitive by default. Most likely A=a.
And if you did get the insert to work, what do you think would happen if text contains proper name?
Thanks for your comment. I very much appreciate it.
I'm a novice user of Word VBA, but as far as I know Word VBA can be case sensitive. If you again look at my code you should notice two things. Firstly, I am using wild chads to search for capitals: My understanding is [A-Z] stands for any capital letter. Secondly, I have set the Find parameter 'MatchWildcards' to 'True'.
Here is an example of a vba search for capital letters using wild cards:
Sub Demo()
Dim fRng As Range
With Selection.Find
.ClearFormatting
.Text = "[A-Z]{3}"
.MatchWildcards = True
.Wrap = wdFindContinue
.Forward = True
Do While .Execute = True
Set fRng = ActiveDocument.Range(Start:=Selection.Start, End:=Selection.End)
If Len(fRng.Words(1)) > 4 And fRng.Words(1).Case = 1 Then _
fRng.Words(1).Font.Color = wdColorDarkRed
Loop
End With
Set fRng = Nothing
End Sub
Source: https://stackoverflow.com/questions/...er-in-word-vba
My problem is that I don't have enough knowledge of Word VBA to get my macro to work.
Thanks again for your comments. I very much appreciate them.