Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Email From Excel List With Attachment

Posted on 2015-01-08
5
Medium Priority
?
92 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 49

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

Tech or Treat! - Giveaway

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

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…
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
Introduction to Processes
Starting up a Project

597 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