views:

35

answers:

1

I’ve got a macro that does a search/replace in a selection but at the end of the task it shows the 'Do you want to search the remainder of the document' dialogue and I never want it to search the remainder so I’d like to have it click ‘n’ and then continue with the rest of the doc.

In is there a way to do this?

+1  A: 

Use:

Application.DisplayAlerts = wdAlertsNone

edit: More detail on the property here- http://msdn.microsoft.com/en-us/library/aa212820(office.11).aspx

unrealtrip
good thought...unfortunately the default value is 'yes' and I need 'no'..80(
Keng
Oops, I totally read right past that (n) part. What about using an application event? http://msdn.microsoft.com/en-us/library/aa140279(office.10).aspx I'm guessing that a dialog box would deactivate the active window? Then you could sendkey an n maybe?
unrealtrip