VBA or sendkeys - mouse move and click

  • Thread starter Thread starter Jane
  • Start date Start date
J

Jane

Hello everyone

I hope you can help me with this.

I have created an access form that opens a number of windows in internet
explorer.
I need to simulate a mouse move and left click to get from one active window
to another.
The amount of move is not that important as long as it's around 2 inches or
so to the left or right, up, or down (basically out of the small Find/Search
window)

I have looked using SendKeys - something like:
{mousemove X,Y}
{mouseclick}
Of course this will not work in VBA but is the something like this available ?

I can use SendKeys Alt-Tab to show the windows panel but then you still have
to use the mouse to click the window you want

I can't use the actual mouse so it all has to be done programmatically

Thank you if you can offer any assistance

Jane
 
hi Jane,

I have created an access form that opens a number of windows in internet
explorer.
I need to simulate a mouse move and left click to get from one active window
to another.
Why do you want to simulate it? Is 'simulation' the correct term? If the
answer is yes then you need to use Win32 API functions, e.g.

GetWindow to find the correct IE window:

http://support.microsoft.com/kb/183009

SendMessage to send any message (this includes the mouse messages) to it:

http://msdn.microsoft.com/en-us/library/ms644950(VS.85).aspx

Otherwise you should explain, what you are trying to achieve.


mfG
--> stefan <--
 
Last edited by a moderator:
have created an access form that opens a number of windows in internet
explorer.
I need to simulate a mouse move and left click to get from one active window
to another.
The amount of move is not that important as long as it's around 2 inches or
so to the left or right, up, or down (basically out of the small Find/Search
window)

if you don't find the solution within VBA or Access don't waste any more time, this will work (guaranteed):
AutoHotkey
https://autohotkey.com/download/

a few sample commands:
mouseclick, left, Xcoordinate, Ycoordinate, NumberOfClicks
mousemove Xcoordinate, Ycoordinate
send {RIGHT,HOME, TAB, DELETE, ETC}
msgbox
SoundBeep
and many more...
to shift back and forth between applicatios use ALT+TAB send !{tab}
don´t forget to use "AutoIt3 Window Spy" (included with AutoHotkey)
best of luck!
 

Attachments

Back
Top