Report

Email with Multiple Attachments through VBA [Solved]

Ask a question Game Start Now 135Posts Thursday January 21, 2010Registration date January 7, 2017 Last seen - Last answered on Jan 10, 2017 at 05:07 PM by ac3mark
Dear All,

I need to send the multiple emails via Outlook through VBA.

Column A Row 2 = Name of Person, Which must be Displayed on .Body
Column B Row 2 = .To Email Address (It could be multiple)
Column C Row 2 = .CC Email Address (It could be multiple)
Column D Row 2 = .Subject
Column E Row 2 = .Attachments.Add (It could be multiple)

Sheet2 is the Matter which must be copy and paste to the .body

I need looping Macro to send the emails one by one with attachments or attachment with the formatted body which is located in Sheet2.


Note: Sheet2 Matter will remain same for all rows.

Thanks in Advance.

Looking forward to your usual co-operation.

Regards,
Game Start Now
See more 
Helpful
+0
plus moins
Well, where are stuck? The mail object? The formatting of the email structure itself? I will not! For certain, will not provide a mailing program turn key. Let us know where you are stuck!
Game Start Now 135Posts Thursday January 21, 2010Registration date January 7, 2017 Last seen - Jan 3, 2017 at 11:38 PM
It doesn't stuck anywhere. I am in need of such Macro.
Reply
ac3mark 7130Posts Monday June 3, 2013Registration date ModeratorStatus June 28, 2017 Last seen - Jan 4, 2017 at 04:14 PM
Sorry, macros cant build and instantiate a mail object! It cannot be done with a macro!

You must include a package on load, and reference it to make it work!
Reply
Leave a comment
Helpful
+0
plus moins
Below code works fine but it allow only one attachment.
I need the macro to add attachments from column H to column Z. If one path is in column H and another path is in column I.

Sub Send_Email()

Sheets("Sheet1").Activate

Range("A3:J55").Select
Application.CutCopyMode = False

ActiveWorkbook.EnvelopeVisible = True

With ActiveSheet.MailEnvelope
Sheets("Sheet2").Select
MYROW = Range("G10000").End(xlUp).Offset(1, 0).Row
.Item.To = Range("D" & MYROW).Value
.Item.CC = Range("E" & MYROW).Value
.Item.Subject = Range("F" & MYROW).Value
.Item.Attachments.Add Range("H" & MYROW).Value
Sheets("Sheet1").Select
.Item.Send
End With


End Sub
ac3mark 7130Posts Monday June 3, 2013Registration date ModeratorStatus June 28, 2017 Last seen - Jan 5, 2017 at 05:21 PM
Make an array of the objects, then loop through the array!

Check this out: https://msdn.microsoft.com/en-us/library/wak0wfyt.aspx
Reply
Game Start Now 135Posts Thursday January 21, 2010Registration date January 7, 2017 Last seen - Jan 5, 2017 at 10:24 PM
I really don't know how to make it.
Reply
ac3mark 7130Posts Monday June 3, 2013Registration date ModeratorStatus June 28, 2017 Last seen - Jan 6, 2017 at 06:27 PM
You aren't even looping through to Z in the above code. If you cannot build a simple loop, then you need to look into loops.
Reply
Game Start Now 135Posts Thursday January 21, 2010Registration date January 7, 2017 Last seen - Jan 7, 2017 at 12:51 AM
If you can do then why don't you help me in this instead of talking.
Reply
ac3mark 7130Posts Monday June 3, 2013Registration date ModeratorStatus June 28, 2017 Last seen - Jan 10, 2017 at 05:07 PM
YOU will learn more if you understand what YOU are doing, not just cutting and pasting what I already understand!
Reply
Leave a comment

Member requests are more likely to be responded to.

Members can monitor the statuses of their requests from their account pages.

A CCM membership gives you access to additional options.

Not a member yet?

Sign up now. It takes less than a minute and is completely free!