View Single Post
 
Old 02-11-2025, 10:45 AM
Tony Hedge Tony Hedge is offline Windows 11 Office 2021
Novice
 
Join Date: Feb 2025
Posts: 1
Tony Hedge is on a distinguished road
Question How to Pause a Macro and Display a Document

I am running Microsoft 365 on Windows 11.


I have developed a Word macro that loops over all the .doc, .docx and .rtf file in a folder and re-formats them.


After I have reformatted each file I wish to display the file briefly (2s) whilst the macro sleeps. I have not found a way to do this.


If I use the Windows Sleep API, it sleeps the document windows as well as the macro.


If have tried using the Excel Wait method, but despite adding a reference to the Microsoft Excel 16.0 Object Library, the macro throws an error when it reaches the Wait statement.


I have tried adding many DoEvent statements, but fails as well.


Does anyone know how to pause a macro (briefly) and display a document window?
Reply With Quote