'How to run code to toggle ShowCursor on Outlook from Excel workbook?
I am using code on Outlook to hide the mouse cursor on Outlook before opening the attached workbook:
Private Declare Function ShowCursor Lib "USER32" (ByVal fShow As Integer) As Integer
Public Sub hide_Cursor()
ShowCursor False
End Sub
After the attached file is opened, I need to do the opposite (show the mouse cursor on Outlook).
I did not find any events on Outlook to run code after an attachment file is opened.
So, I need the following code to run from the Excel workbook.
It has no effect. The mouse cursor is still hidden on Outlook.
Private Declare Function ShowCursor Lib "USER32" (ByVal fShow As Integer) As Integer
Public Sub Show_Cursor()
ShowCursor True
End Sub
Solution 1:[1]
The ShowCursor function applies only to the process from which it was called. So, to get back the cursor you need to call the method from the Outlook process, not Excel.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Eugene Astafiev |