+ Reply to Thread
Results 1 to 4 of 4

Thread: How to switch off Word Windows popping up while running a Macro

  1. #1
    Registered User
    Join Date
    09-17-2008
    Location
    Europe
    Posts
    46

    How to switch off Word Windows popping up while running a Macro

    Hi All,

    I created a macro to make some find and replace actions.

    However, when the macro runs a notification screen pops up where the user has to select Y or N. This is the message I'm getting:

    "Word has finished searching the selection. 22 replacements were made. Do you want to search the remainder of the document?"

    Is there a way I can automatically set the answer to Yes in order not to get this warning every time?


    regards,

  2. #2
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    MS-Off Ver
    What does it matter?
    Posts
    3,933

    Re: How to switch off Word Windows popping up while running a Macro

    Not 100% sure but maybe:

    Application.DisplayAlerts = wdAlertsNone
    
    ' your code
    
    Application.DisplayAlerts = wdAlertsAll

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  3. #3
    Valued Forum Contributor
    Join Date
    11-15-2007
    Location
    England
    MS-Off Ver
    Office Pro 2003
    Posts
    209

    Re: How to switch off Word Windows popping up while running a Macro

    I don't know about macros for Word documents but working in Excel it would be

    Application.DisplayAlerts = False
    Your Code

    Application.DisplayAlerts = True

  4. #4
    Registered User
    Join Date
    09-17-2008
    Location
    Europe
    Posts
    46

    Re: How to switch off Word Windows popping up while running a Macro

    Thanks,

    It worked great.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0