i am trying to write a code that opens a scrn shot Programme to take scrn shots using VBA,
so the Problem is with the mouse function that i would like the function to click then hold the click and to Change the Position(X,Y) of the Cursor to take the scrn shot as i want it to.
ScreenshotReaderID = Shell("C:\Program Files (x86)\ABBYY Screenshot Reader 11\ScreenshotReader.exe", vbNormalFocus)
' AppActivate (ScreenshotReaderID)
here is my code that im trying out
i know the code is wrong but thats what i could gather after reading and checking many forums
Application.Wait (Now() + TimeValue("00:00:3"))
Beep
SendKeys "%{TAB}", True
Beep
Application.Wait (Now() + TimeValue("00:00:1"))
Beep
'SendKeys "%~", True
Application.Wait (Now() + TimeValue("00:00:1"))
Call GetCursorPos(Pt)
aX = Pt.X
aY = Pt.Y
If aY > 100 Then aY = aY - 15
If aX > 100 Then aX = aX - 20
aY = 130
aX = 1120
Call SetCursorPos(aX, aY)
'MsgBox ("1")
'Stop
mouse_event MOUSEEVENTF_LEFTDOWN, 500, 500, 0, 0
'Call SetCursorPos(aX + 100, aY + 100)
mouse_event MOUSEEVENTF_LEFTUP, 600, 600, 0, 0
MsgBox ("dfg")
mouse_event MOUSEEVENTF_LEFTDOWN, 500, 500, 0, 0
'Call SetCursorPos(aX + 100, aY + 100)
mouse_event MOUSEEVENTF_LEFTUP, 600, 600, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 500, 500, 0, 0
Call SetCursorPos(aX + 100, aY + 100)
mouse_event MOUSEEVENTF_LEFTUP, 600, 600, 0, 0
MsgBox ("2dfg")
GoTo nochmal
End Sub
so the Problem is with the mouse function that i would like the function to click then hold the click and to Change the Position(X,Y) of the Cursor to take the scrn shot as i want it to.
ScreenshotReaderID = Shell("C:\Program Files (x86)\ABBYY Screenshot Reader 11\ScreenshotReader.exe", vbNormalFocus)
' AppActivate (ScreenshotReaderID)
here is my code that im trying out
i know the code is wrong but thats what i could gather after reading and checking many forums
Application.Wait (Now() + TimeValue("00:00:3"))
Beep
SendKeys "%{TAB}", True
Beep
Application.Wait (Now() + TimeValue("00:00:1"))
Beep
'SendKeys "%~", True
Application.Wait (Now() + TimeValue("00:00:1"))
Call GetCursorPos(Pt)
aX = Pt.X
aY = Pt.Y
If aY > 100 Then aY = aY - 15
If aX > 100 Then aX = aX - 20
aY = 130
aX = 1120
Call SetCursorPos(aX, aY)
'MsgBox ("1")
'Stop
mouse_event MOUSEEVENTF_LEFTDOWN, 500, 500, 0, 0
'Call SetCursorPos(aX + 100, aY + 100)
mouse_event MOUSEEVENTF_LEFTUP, 600, 600, 0, 0
MsgBox ("dfg")
mouse_event MOUSEEVENTF_LEFTDOWN, 500, 500, 0, 0
'Call SetCursorPos(aX + 100, aY + 100)
mouse_event MOUSEEVENTF_LEFTUP, 600, 600, 0, 0
mouse_event MOUSEEVENTF_LEFTDOWN, 500, 500, 0, 0
Call SetCursorPos(aX + 100, aY + 100)
mouse_event MOUSEEVENTF_LEFTUP, 600, 600, 0, 0
MsgBox ("2dfg")
GoTo nochmal
End Sub