Z Zone Jan 26, 2007 #1 I want to position the mouse on the screen and press a shortcut key (like Ctrl-d) to get the mouse coordinates. Thanks, James
I want to position the mouse on the screen and press a shortcut key (like Ctrl-d) to get the mouse coordinates. Thanks, James
G Guest Jan 26, 2007 #2 Declare Function GetCursorPos Lib "user32" _ (lpPoint As POINTAPI) As Long Type POINTAPI X As Long Y As Long End Type Sub ShowPos() Dim lRetVal As Long Dim Pos As POINTAPI lRetVal = GetCursorPos(Pos) MsgBox Pos.X & ", " & Pos.Y End Sub You can use the OnKey method to assign it to a shortcut combination or select options in Tools=>Macro=>Macros after you select your macro.
Declare Function GetCursorPos Lib "user32" _ (lpPoint As POINTAPI) As Long Type POINTAPI X As Long Y As Long End Type Sub ShowPos() Dim lRetVal As Long Dim Pos As POINTAPI lRetVal = GetCursorPos(Pos) MsgBox Pos.X & ", " & Pos.Y End Sub You can use the OnKey method to assign it to a shortcut combination or select options in Tools=>Macro=>Macros after you select your macro.