0

I am using Visual Basic for Applications, and in my program, I am opening Inventor parts and capturing thumbnails. I get undesirable results if the mouse tip is left hovering over the parts. I would like to be able to re-position the cursor such that it is well out of the way.

Any VBA code that accomplishes this along with the required references would be much appreciated.

1 Answer 1

2

You can use the SetCursorPos API for this, although the UX might be horrible if you don't put it back where you found it:

Private Declare Sub SetCursorPos Lib "user32.dll" (x As Long, y As Long)

Sub Example()
    SetCursorPos 0, 0
End Sub

If you do want to restore the original location, just grab it with GetCursorPos first.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.