![]() |
|
#1
|
|||
|
|||
|
Greetings,
Is there a way to... We send a mail to each of our service people on the road with their time-table data made in excel. We do this each month, always the same file to the same person and this for 20 people. Is there a way to automate the creation of the mail and/or the adding of the file? Thank you! |
|
#2
|
|||
|
|||
|
Maybe something like this?
Code:
Sub Email_Attachment_To_Group()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.To = "person1@email.com;person2@email.com" ' List of addresses to send
.CC = ""
.BCC = ""
.Subject = "Monthly spreadsheet"
.Body = "Attached is the monthly spreadsheet."
.Attachments.Add ("C:\Users\123456\Documents\Monthly\test.txt") ' Specify full path to the file to attach
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
|
|
#3
|
||||
|
||||
|
If you have 20 recipients, mail merge would make sense. Assuming each employee has a different variation of the worksheet then you could use E-Mail Merge Add-in to merge to e-mail with the filenames and recipients taken from the datasheet.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Auto generate X pages from input
|
lipatin | Word VBA | 12 | 06-01-2018 12:13 AM |
| How to auto-generate whole Powerpoint presentations from a set of data? | olibot2000 | PowerPoint | 1 | 06-24-2017 09:01 PM |
| Auto Generate Invoice Number Word 2013 | Jonah245 | Word VBA | 3 | 09-04-2014 05:24 PM |
email as pdf attachment - subject line and attachment named after mail merge
|
Nexus | Mail Merge | 12 | 04-13-2011 11:34 PM |
| Word attachment on an E-mail-macro to open attachment & | nablady | Outlook | 0 | 11-28-2006 03:00 PM |