|
-
January 29th, 2000, 08:07 PM
#1
Macro interrupt
I have written a macro in Word 97 where all text is selected, certain characters are looked for and replaced. (see below)
The macro works find. However, at the end of the replace process, the macro stops and displays the window where it tells me that the selection had been searched and whether I want the process done for the rest of the document.
It is annoying that the macro stops and asks for the input. Is there any way that I can suppress this message. Especially, since as part of the macro the whole document is selected.
Thanks for your help. Any response is appreciated.
Issam
Selection.WholeStory
Selection.Font.Size = 12
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = " "
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindAsk
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
-
February 29th, 2000, 06:29 PM
#2
Wow ... there doesn't seem to be a flag to stop it from doing that ... how annoying is that!
Anyway, when all else fails, it's always useful to try a SendKeys event. I was able to make it work using that. In my example I ended up having to manually press Enter twice to get past the messages on the screen, so I had to do the following in front of the final command to execute the Replace, as below:
SendKeys "{enter}{enter}" Selection.Find.Execute Replace:=wdReplaceAll
-
March 3rd, 2000, 03:06 PM
#3
Great Advice! That worked just fine. It all happens seemlessly. So thanks a lot.
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|