Solved

Email From Excel List With Attachment

Posted on 2015-01-08
5
84 Views
Last Modified: 2016-02-10
I have a list of pdf files that I send to instructors for their schedules each semester. I'd like to automate sending them the email and attachment instead of having to email and attach each one. I've attached an example but there's no vba code attached to the button (assuming that's what we'll need to make it happen). I'd like to click the button and have the emails sent with their individual attachments - make sense? I would need to use the default email client (in my case its GroupWise). Thanks!
Email-List.xlsx
0
Comment
Question by:tracyms
5 Comments
 
LVL 32

Expert Comment

by:Rob Henson
ID: 40539946
Have you looked at using MS Word Mail Merge?

Not sure how that handles the attachments though.

Thanks
Rob H
0
 
LVL 5

Accepted Solution

by:
Hakan Yılmaz earned 500 total points
ID: 40540044
Try this for Outlook
Sub sendall()

    Dim appOutlook As Object
    Dim iterMailNo As Integer
    Dim iterMail As Object
    Dim MailCount As Integer

    Set appOutlook = CreateObject("Outlook.Application")

    MailCount = Sheet1.Cells(1, 1).End(xlDown).Row - 1
    For iterMailNo = 1 To MailCount
        Set iterMail = appOutlook.CreateItem(0)
        iterMail.To = Sheet1.Cells(iterMailNo + 1, 1).Value2
        iterMail.Subject = Sheet1.Cells(iterMailNo + 1, 2).Value2
        iterMail.Body = Sheet1.Cells(iterMailNo + 1, 3).Value2
        iterMail.Attachments.Add (Sheet1.Cells(iterMailNo + 1, 6).Value2)
        iterMail.Send
        Set iterMail = Nothing
    Next

End Sub

Open in new window

0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 40594795
I've requested that this question be closed as follows:

Accepted answer: 500 points for Hakan Yılmaz's comment #a40540044

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 

Author Comment

by:tracyms
ID: 40594799
Sorry for the delay. I did accept the solution, however I stated "I would need to use the default email client (in my case its GroupWise)" but the solution was for Outlook. Thank you.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now