Disable click activity when using Do..While pause with OLE Word Doc (1 Viewer)

Kronix

Registered User.
Local time
Today, 12:26
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).
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 20:26
Joined
Jan 20, 2009
Messages
12,856
You could loop through the Forms Collection and assign Enabled = False.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 18:26
Joined
May 7, 2009
Messages
19,246
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

Top Bottom