I have this format.
Sally
I m a girl.
I want the macros to check when the word "Sally" is encounter is displayed
then the sentence after the word Sally should be brought to the next line and
the first word after the line break should be captalized.( like the format
given above).
If format is given like this
Sally I m a girl
(or)
Sally i m a girl
The macros must "select" wrong format. Give a message saying wrong with yes
and no button. if user select "Yes" button then the sentence after the word
Sally should be brought to the next line and the first word after the line
break should be captalized.
If the user clicks the no button then the it must check for next format if
available in the document.
But i m trying to implement this by using this macro whihc i have tried but
i mnot gettin excepted result.
can someone direct me
Sub jf()
Dim oRng As Range
Dim sCase As String
With Selection
..HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
Do While .Execute("Sally [A-Z]{1,}>", _
MatchWildcards:=True)
Set oRng = Selection.Range
oRng.Select
sCase = MsgBox(oRng.Text & "Change now", vbYesNo, "Change Case")
If sCase = vbYes Then
' oRng.Case = wdLowerCase
oRng = Replace(oRng.Text, "Sally", "Sally Chr(11)")
End If
Selection.Collapse wdCollapseEnd
Loop
End With
End With
End Sub