![]() |
|
#2
|
||||
|
||||
|
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] |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| VBA in Excel: Add a new Word Document on Template (Type Mismatch Error)) | tinfanide | Excel Programming | 1 | 03-29-2012 09:10 AM |
Finding or searching ^ character in word document
|
shahin3121 | Word | 2 | 03-05-2012 06:16 PM |
Microsoft Code Error 1907
|
JHauglid | Office | 1 | 02-27-2012 12:15 AM |
| Error code 0x800CCC80 | Kevin | Outlook | 1 | 03-18-2011 07:20 AM |
| Word: The document 'Filename' caused a serious error the last time ... | martincruise | Word | 0 | 02-25-2010 01:47 AM |