?
Solved

Email From Excel List With Attachment

Posted on 2015-01-08
5
Medium Priority
?
89 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 33

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 2000 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 48

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
 
LVL 1

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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

770 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