PDA

View Full Version : Email userform



Svmaxcel
10-14-2017, 08:08 AM
I completed my userform, wanted to know how to email the filled form via outlook.
I mean copy/paste userform as image

Kenneth Hobs
10-14-2017, 09:09 AM
I am unclear what you mean by the last part. Did you want it in the email as an image file attached or embedded in the body of the email?

Is this to be done while the userform is active in its code? Or should a macro find the userform, open it, copy, send email, and close it?

Svmaxcel
10-14-2017, 10:31 AM
The user form runs by click of a cell
After I fill in all details in userform it is copied to worksheet.
I have made buttons in userform to save the record and save and send.
I want when I click on save and send, record should be saved and the same userform should be emailed to employee.
I know about outlook code, but I don't know how can I send the userform as an image in email.
I don't want it as attachment

Kenneth Hobs
10-14-2017, 10:49 AM
In post #3, are you saying that you have already copied the userform to the worksheet or you want to add that as well?

Svmaxcel
10-14-2017, 11:14 AM
Let me explain with an example in detail
I have a userform (ABC)
It has 2 lables (Emp I'd and Name)
It has 2 text box (for entering Emp I'd and name)
It has 2 buttons (Save and Save and Send)
When I click save button the Emp I'd and Names are saved to Sheet 1 as text.
I also want to email the userform to the employees.
So when I click on Save and Send.
Excel should use print screen option and copy the filled userform.
After that outlook should open and paste the userform as a image in the mail

Kenneth Hobs
10-14-2017, 11:34 AM
Ok, so you need both copy Userform and email with it pasted in the body. I will show you how shortly.

There are two ways to copy the current window. One is a SendKeys() or API SendKeys() method. API is the better route. Even so, there are other API methods that I like better that I will use.

For the email part, I will use Outlook since it allows us to use the Suite's Word object.

Kenneth Hobs
10-14-2017, 12:25 PM
It is easier to show you by an example file. The example for you is UserForm1. Click the button on the first sheet to show it. Fill in the To and Subject boxes and click the button. It will Display the email.

This has an example that uses some other methods and handy tools as well.

aqibi2000
10-23-2017, 07:25 AM
Very good

Svmaxcel
10-23-2017, 11:50 PM
Print screen/Snip tool is disabled in the system.
Cannot be used
Any other alternatives.

Kenneth Hobs
10-24-2017, 06:38 AM
If you mean manually snipping in Windows, I guess you mean Snipping Tool. OneNote is better. Surely that is not disabled. Run once and then Win+S or Win+Shift+S will allow snipping.

Svmaxcel
10-24-2017, 06:42 AM
I am sorry, but most of the features are disabled in system.
Can't even combine windows taskbar icons.
Only thing that works is excel, word, outlook, Is(with site restrictions) that's it

Kenneth Hobs
10-24-2017, 07:03 AM
That is very restrictive. So PowerPoint does not work either? As you should know, OneNote is a standard application in the Office Suite.

Svmaxcel
10-24-2017, 07:36 AM
One note, ppt also restricted.
Print screen, snipping tool, drive icons
Everything restricts

Svmaxcel
10-24-2017, 07:37 AM
I searched the web and found that we can use vk snap method.
Not sure what that us, but it copy the screen like a print screen