jamieleeuk
Board Regular
- Joined
- Feb 9, 2009
- Messages
- 99
Is it possible to send a screenshot of a userform via an email to a specific email address once a button has been pressed on said userform?
Sub PrintTheScreen()
Application.SendKeys "(%{1068})"
DoEvents
End Sub
'Written: October 23, 2008
'Author: Leith Ross
'Summary: Capture the screen image as a picture. VBA SendKeys won't do this function.
' It can be done using the WIndows API. The imageis automatically transfered
' to the clipboard.
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal _
bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const KEYEVENTF_KEYUP = &H2
Private Const VK_SNAPSHOT = &H2C
Private Const VK_MENU = &H12
Sub ScreenCapture()
keybd_event VK_MENU, 0, 0, 0
keybd_event VK_SNAPSHOT, 0, 0, 0
keybd_event VK_SNAPSHOT, 0, KEYEVENTF_KEYUP, 0
keybd_event VK_MENU, 0, KEYEVENTF_KEYUP, 0
End Sub