-
Thanks for your reply Paul.
1. The idea is to allow the user to edit the Word docs once the UserForm1 has popped up and the loop has been entered. After the user has finished doing whatever editing, they click the [Continue] button on the UserForm1. The click event handler unloads the form. Back in the main macro, the loop then detects that the form is no longer visible, so the loop exits and the macro continues to run through the rest of the document. Without the DoEvents in the loop the user can't do any editing in Word - the running macro "locks" the user out, so to speak...
Before discovering DoEvents, when I tested any sort of wait or sleep function (such as: Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal Milliseconds As LongPtr) ), the user can't do anything in Word during the wait or sleep period either.
2. Oh, yes, of course! Thank you! This whole CompareSameTextIn2Docs was based on the ColourNIVWordsRed macro I wrote some months back. At that time I didn't think I could nest Range.Find processes, so had the top level loop use For-Each-Next for all paragraphs, and then a Range.Find once any "Bible Text" Style paragraph was detected. You'll notice I found I could nest Range.Find's and have done that in CompareSameTextIn2Docs. I will now update the code to use a Range.Find to replace the For-Each-Next - thanks!
Best regards,
Peter
Last edited by macropod; 09-16-2024 at 05:46 PM.
Reason: Typos
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