Solved

Email From Excel List With Attachment

Posted on 2015-01-08
5
86 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 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 47

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Use Windows Task Scheduler to print a Word document weekly so your printer ink won't dry out.
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…

726 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