View Single Post
 
Old 05-17-2012, 02:03 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

So why not prefix the code with 'On Error Resume Next'? Alternatively, you could trap that specific error. For example:
Code:
Sub ReplaceAvenue()
On Error GoTo Done
With Application.Dialogs(wdDialogEditReplace)
  SendKeys "%m"
  With Selection.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Text = "Ave"
    .Replacement.Text = "Avenue"
    .Forward = True
    .Wrap = wdFindStop
    .Format = False
    .MatchCase = True
    .MatchWholeWord = True
    .MatchWildcards = False
    .MatchSoundsLike = False
    .MatchAllWordForms = False
  End With
  .Show
End With
Done:
If Err.Number = 5452 Then Exit Sub
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote