Recurring email and attachments

J

JenniferCHW

I have been using various help tools and was able to create a script that
creates a recurring email that meets most of my needs. I am looking to add
an attachment to that email. I have looked at several posts on this help and
can't seem to make any of them work. Can you help incorporate this into my
script. Current script is posted below.

Sub Item_PropertyChange (ByVal Name)
Select Case Name
Case "Status"
if Item.Status = 2 then '2 = Completed
Set NewItem = Application.CreateItem(0)
NewItem.To = "srdh_everyone@XXX"
NewItem.Recipients.ResolveAll
NewItem.Subject = "Payroll Reminder"
NewItem.Body = "To all employees: " & vbCrLf & " " & vbCrLf & "The pay
period is coming to a close. Please use the attached form to account for
your Community Outreach / Social Accountability hours as they pertain to this
pay period. The completed form should be submitted to your Ceridian
Timekeeper for input into the system."
NewItem.Display
End IF
End Select
End Sub

Thanks for your help.
 
Joined
Dec 3, 2008
Messages
2
Reaction score
0
this wil help i guess

Sub AddAttachment()
Dim myItem As Outlook.MailItem
Dim myAttachments As Outlook.Attachments

Set myItem = Application.CreateItem(olMailItem)
Set myAttachments = myItem.Attachments
myAttachments.Add "C:\Test.doc", _
olByValue, 1, "Test"
myItem.Display
End Sub
 
K

Ken Slovak - [MVP - Outlook]

' previous code
NewItem.Save
NewItem.Attachments.Add "string path to the file to attach"

NewItem.Display
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top