View Single Post
 
Old 05-16-2012, 10:07 PM
Charles Kenyon Charles Kenyon is offline Windows Vista Office 2010 32bit
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,459
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default Error Code 5453 Word has finished searching the document

I have a series of macros that replace given text in a document. Actually, they set up the Advanced Replace dialog so that the user can decide for each instance whether to replace or not.

The user clicks on the Find Next button and decides. After the search is complete and the cursor is back at the first page, pressing Close or Cancel in the Replace Dialog results in the error message:
Error Code 5453
Word has finished searching the document

The code for a macro follows:
Code:
Sub ReplaceAvenue()
'
' ReplaceAvenue Macro
'
'
    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
    SendKeys "%m"
    Application.Dialogs(wdDialogEditReplace).Show
End Sub
As you can probably tell, it is based on a recorded macro. I can live with this but it is annoying.
Reply With Quote