D
Designingsally
Hi I have been getting this error messaget when i m executing the macro given
below. I know the macro is perfect. I think the problem lies with the
declaration. When i m trying to use -/ or some other special characters this
problem is ocuring.
post me ur thoughts into this thanks in advance
Dim orng As Range
Dim sRep As String
Dim sFindText As String
Dim sRepText As String
sFindText = "Re-enter" 'the word to find
sRepText = "reenter" 'the word to replace
With Selection
..HomeKey wdStory
With .FInd
..ClearFormatting
..Replacement.ClearFormatting
..Wrap = wdFindContinue
..Format = False
..MatchCase = False
..MatchWholeWord = True
..MatchWildcards = False
..MatchSoundsLike = False
..MatchAllWordForms = False
While .Execute(findText:=sFindText)
Set orng = Selection.Range
sRep = Msgbox("The Recommended Word is and so on. Replace?", vbYesNoCancel)
If sRep = vbCancel Then
Exit Sub
End If
If sRep = vbYes Then
orng.Text = sRepText
End If
Wend
End With
End With
End Sub
below. I know the macro is perfect. I think the problem lies with the
declaration. When i m trying to use -/ or some other special characters this
problem is ocuring.
post me ur thoughts into this thanks in advance
Dim orng As Range
Dim sRep As String
Dim sFindText As String
Dim sRepText As String
sFindText = "Re-enter" 'the word to find
sRepText = "reenter" 'the word to replace
With Selection
..HomeKey wdStory
With .FInd
..ClearFormatting
..Replacement.ClearFormatting
..Wrap = wdFindContinue
..Format = False
..MatchCase = False
..MatchWholeWord = True
..MatchWildcards = False
..MatchSoundsLike = False
..MatchAllWordForms = False
While .Execute(findText:=sFindText)
Set orng = Selection.Range
sRep = Msgbox("The Recommended Word is and so on. Replace?", vbYesNoCancel)
If sRep = vbCancel Then
Exit Sub
End If
If sRep = vbYes Then
orng.Text = sRepText
End If
Wend
End With
End With
End Sub