PDA

View Full Version : Send Email Via Excel and store a copy in Excel



BACI
01-20-2014, 09:20 AM
Hi All,

Thank you all for all the previous assistance and learnings. As I am new to VBA and still learning, need your help on creating a macro.

Need assistance on a macro which will send email from excel

1. I need to create a macro in excel to send E-mail through outlook which will copy some rows and column from excel and paste and in specific format in outlook and send an email to specific team member, the email will also appear a button on each email which states "yes/no" or "accept/Deny. when a recipient receive the email

2. When the specific team member click of "yes/no" or "accept/Deny". The email should come back to the sender and a copy of that email will also store in the same excel worksheet from which the email is sent


Please assist

Regards,
BACI

westconn1
01-20-2014, 01:35 PM
Need assistance on a macro which will send email from excel

what part you need assistance with?
sending email, formatting body, or putting reply back into worksheet?

BACI
01-20-2014, 07:30 PM
Hi westconn1,

Thank you for your reply. I have prepared a macro to send email but could not apply code for button n formatting.

Hence request assistance on entire 3 part.

Thank you for all your guidance

BACI
01-21-2014, 09:14 PM
Hi

Any assistance?

Ildestino
01-22-2014, 12:42 AM
Hello

Create a button in excel (like any kind of button)

Open your VBA editing in excel.

Create a Modul

Paste this

Sub M_snb()
ActiveWorkbook.SaveAs "C:XXXXXXX dunno where you want to save it"

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next
With OutMail
.To =
.CC = ""
.BCC = ""
.Subject =
.Body = ""

.Attachments.Add ActiveWorkbook.FullName
.Display
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing
End Sub



hope it works

westconn1
01-22-2014, 03:24 AM
for an active button to be placed in the email, your recipients would have to have html turned on, and i would not be surprised if outlook would block an email with vbs code as a virus, though that may be a mistaken assumption, as i have not tried

i would suggest using a read receipt, with a macro (or add in) in each recipients outlook to attach a copy of the email to the read receipt reply

can not help with formatting the data as you have not provided any sample data, or other detail

BACI
01-22-2014, 02:34 PM
Hi westconn1,

Thank you for your reply, I try and study the same and come back with the formatting sample.

Regards

westconn1
01-23-2014, 04:11 AM
see this thread for ideas on sending email from task
www.vbaexpress.com/forum/showthread.php?48730-Outlook-2007-E-Mail-From-Selected-Task&p=303650#post303650