I am in need of some way to capture a screen shot of a program on screen and send it to a specified email address at a certain time of the day. I would not think its impossible, could it be done using vba code?
I am in need of some way to capture a screen shot of a program on screen and send it to a specified email address at a certain time of the day. I would not think its impossible, could it be done using vba code?
Is it an xl screenshot?I am in need of some way to capture a screen shot of a program on screen
It would be of another program open on the desktop. I am also thinking it may be easier to have it save the screenshot to a folder instead of emailing it.
Hello ge0rge,
It is doable. I will be out of my office for a while, but will dig the code up when I get back.
Sincerely,
Leith Ross
That would be great. In the meantime I am going to give it a go.
Hello ge0rge,
Capturing the screen is the easy part. I am having problems with embedding a picture in Outlook. Not sure if is my email setup or a problem with Outlook. I'll keep you updated.
Macro Code to Capture the Screen
Sincerely,![]()
'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 image is 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
Leith Ross
(deleted)...
Hello Leith,
I found you here tooMay you remember my problem from another forum. I think I have mistake combining two codes together. Here are two codes I am working on. First one is "ScreenCapture" to copy the active window into clipboard and second one is "emailimage" to paste clipboard to outlook mail. If I run them seperately with two buttons (click first then second), they do what I want. However I cannot combine them to run just with 1 click (I have used Call code, but screencapture is not seems to work properly ). How can I combine them together or run them properly with just 1 click?
1.Code: "Screencapture"
2.Code: "emailimage" to paste clipboard into email body![]()
'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 image is 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
3. Runboth:![]()
Sub emailimage() Dim OutApp As Object Dim OutMail As Object 'Shift-Print Screen Application.SendKeys "(%{1068})" 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 = "youremail@test.com" .Subject = "Subject line" .Display Application.SendKeys "(^v)" End With On Error GoTo 0 OutApp.Session.Logoff Set OutMail = Nothing Set OutApp = Nothing End Sub
![]()
Sub Runboth() Call ScreenCapture Call emailimage End Sub
Last edited by huseyinkasirga; 02-06-2012 at 06:19 PM.
Dear All,
Can anybody help me about the problem mentioned above?
Thanks in advance.
Please take a moment to read the forum rules.
Dom2. Don't post a question in the thread of another member -- start your own. If you feel it's particularly relevant, provide a link to the other thread.
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks