Prefixing errror

S

Sahana

I got macro displayed below which prefixs - before "oriented". When i
test the word action-oriented separately i m not displayed the message
box.

When i test

So, make sure that you're action-oriented and ready to fulfil your end
of the action bargain.

I m displayed a message box asking to prefix - before oriented when
oriented is already prefix.

why am i facing this problem and what could be the solution??

code is

Sub oriented1()
Dim oRng As Range
Set oRng = ActiveDocument.Range
With oRng
With .FInd
.ClearFormatting
.Replacement.ClearFormatting
Do While .Execute("oriented [A-Za-z]{1,}>", MatchWildcards:=True)
oRng.Select 'Word processing
Select Case Msgbox(Chr(34) & "oriented" & Chr(34) & " on page "
& Selection.Information(wdActiveEndPageNumber) & " should be prefixed
with a hyphen. Please clarify specific instances using the
dictionary.", vbYesNoCancel, "Oriented")
Case vbCancel
Exit Sub
Case vbYes
oRng = Replace(oRng.Text, "oriented", "-oriented")

End Select
oRng.Collapse wdCollapseEnd
Loop
End With
End With
End Sub
 
D

Doug Robbins - Word MVP

You should be looking for

[!\-]oriented

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

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