Recurring email with attachment

  • Thread starter Thread starter phil Rutter
  • Start date Start date
P

phil Rutter

-----Original Message-----
I am creating a recurring email based on the code
described in Microsoft Knowledge Base Article 239087. My
question is what additional code do I need to include an
attachment to the recurring email. The currnet code is as
follows:

Sub Item_PropertyChange(ByVal Name)
Select Case Name
Case "Status"
if Item.Status = 2 then '2 = Completed
Set NewItem = Application.CreateItem(0)
NewItem.To = "(e-mail address removed)"
NewItem.Recipients.ResolveAll
NewItem.Subject = "This is the message
subject text"
NewItem.Body = "This is text that will
appear in the body of the message."
NewItem.Display
End IF
End Select
End Sub


Hope this helps
.Sub Sendmessage(Optional AttachmentPath)
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim sendto As Outlook.Recipient
Dim Attach As Outlook.Attachment

'message to rep number 10
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
Set sendto = .Recipients.Add("EMAIL ADDRESS HERE")
sendto.Type = olTo
.Body = "Hi please see attached files"
.Subject = "End of month sales reports for" & MonthName
(Month(Date) - 1, False)
.Importance = olImportanceHigh
.Attachments.Add ("ATTACHMENT #1")
.Attachments.Add ("ATTACHMENT #2")
.Attachments.Add ("ATTACHMENT #3")
.Send
 
Back
Top