From: James Avenant on 27 Jul 2010 03:32 Hi, All and all you need to write client code to manipulate the window on your behalf. So first, from an Access macro, you need to get a handle to the window that you are interested in. You may need to import the correct Win32 API to do this. Use a sniffer like Visual Studio's Spy tool to get the Window name or handle class. Once you have an actual window handle (hWnd pointer which will change for every execution) you can use this to send all kinds of Windows events, including fake mouse movements. You would need to find a way to do this from a separate thread than your batch job, otherwise you may simply have a lot of movement after your job is finished. Also, in certain scenarios, Office (Access) may be running in a background mode and not interact with Windows' UI layer. This is why Office Automation (from Office as well as out of Office) is and always has been a bit of a black art (VSTO is solving this somewhat). So all-and-all it can be done, but you are actually facing a problem domain that has it's own set of problems. You can read up on "automated UI testing" since these guys do similar things (how to automate mouse and keystrokes while running batch processes). Getting the administrator to extend the timeout may strech your political skills, but is still easier than writing a script that works predictably :-) Good luck. JamesA *** Sent via Developersdex http://www.developersdex.com ***
|
Pages: 1 Prev: How to Populate Subform Automatically Next: Pictures on command buttons |