I use MS Word to basically work around a bunch of limitations in another piece of garbage application my company uses. I write macros to speed things I need to do. One macro I have is:
Code:
Sub ConvertSelectedNumberstoText()
'
' ConvertSelectedNumberstoText Macro
'
'
ActiveDocument.ConvertNumbersToText
With Selection.Find
.Text = "^t"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
End With
Selection.Copy
ActiveDocument.Undo
End Sub
At the line in bold red above, Word prompts me with Word has reached the end of the document. x replacements were made. Do you want to continue searching at the beginning. I click no.
The text in my document that was previously copied is no longer selected, so the remainder of the macro does nothing useful. I think the copy line errors with a nothing is selected error.
What I want to know is if it is possible to perform the execute silently not continuing the search. I want it to leave my selection alone so that the remainder of the macro will complete.
Anyone have ideas? I see nothing obvious in the Execute method help.
Thanks