Macros to indicate words like NOTE, TIPS

D

Designingsally

Hi

I want macro program which can highlight : immediately
after the words Note, and note
Is it possible to highlight : and letter immediately following the :. If the
letter colon is in Lower case, it must be replaced in to lower case and colon
shd be deleted.give a message box with two button Yes and No. When the user
clicks Yes,
letter immediately follwing the : shd be changed into lower case and : must
be deleted. When the user clicks No then it
moves to next sequence. It shd happen sequentially.

Ie

When the user types

Note: this is dangerous.
The macros must highlight : and highlight t(which is in the small caps) and
then a msgbox must appear
with some message.

This process must be sequential( one by one)


Thanks for helping this novice:)
 
G

Graham Mayor

You asked an almost identical question to which I replied on the 28th July.
The macro I provided then can be easily modified to remove the colon and
convert to lower case

Dim oRng As Range
Dim sCase As String
With Selection
..HomeKey wdStory
With .Find
.ClearFormatting
.Replacement.ClearFormatting
Do While .Execute(": [A-Z][a-zA-Z]{1,}>", _
MatchWildcards:=True)
Set oRng = Selection.Range
oRng.Select
sCase = MsgBox(oRng.Text & " selected." & vbCr & _
"Change to lower case?", vbYesNo, "Change Case")
If sCase = vbYes Then
oRng.Case = wdLowerCase
oRng = Replace(oRng.Text, ":", "")
End If
Selection.Collapse wdCollapseEnd
Loop
End With
End With

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top