Disable click activity when using Do..While pause with OLE Word Doc

Kronix

Registered User.
Local time
Today, 11:46
Joined
Nov 2, 2017
Messages
102
I am using a Do While statement to have Access pause when editing an OLE Word embedded object until the Word window is closed. While the Word program is open, it stays on top of the Access program even if I click on the forms in the access program behind it. This is how I want it, except after I close the Word program and the Do While exits, the clicks that I made all register at once, such as switching windows and pressing buttons. How can I make it so that the clicks on Access while the Word document is open don't register in Access afterwards? I thought about using the .Enabled=False property for forms, but there can be a variable number of forms on the screen at any given time (Access forms are running in window mode).
 
You could loop through the Forms Collection and assign Enabled = False.
 
Maybe create a module wise boolean variable.
Set its value to True before entering the Loop.
When your word exits the event to code are Mousedown, mouseup event.
check if the variable is set and id so cancel the event.

Or clip the cursor ti stay on the word window.
You may search the api on how to confine the cursor within a rectangular area.
 

Users who are viewing this thread

Back
Top Bottom