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?
|