Hi,
I am try to paste a screenshot of a userform in to an email body but can not get it work could some take a look at my code and see if I have missed something.
Regards
Also posted on Ozgrid:
I am try to paste a screenshot of a userform in to an email body but can not get it work could some take a look at my code and see if I have missed something.
VBA Code:
Dim OutApp As Object
Dim OutMail As Object
'Shift-Print Screen
Application.SendKeys "(%{1068})"
DoEvents
On Error Resume Next
'Prepare the email
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = "myemail.co.uk"
.Subject = "TEST"
Application.SendKeys "(^v)"
.Send
End With
On Error GoTo 0
OutApp.Session.Logoff
Set OutMail = Nothing
Set OutApp = Nothing
Regards
Also posted on Ozgrid:
Take screenshot of userform and paste into email body - OzGrid Free Excel/VBA Help Forum
Hi, i have a userform and when a wrong input is inserted it gives them a fail message and auto sends an email, I am wanting to take a screenshot of the userform and send automatically, I have got to a point where it auto sends the email but it's not…
www.ozgrid.com