Solved

Email From Excel List With Attachment

Posted on 2015-01-08
5
82 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 31

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 45

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

743 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

10 Experts available now in Live!

Get 1:1 Help Now