troubleshooting Question

Outlook Visual Basic - Reminder Event

Avatar of DavidRGarner
DavidRGarner asked on
Microsoft OfficeOutlookMicrosoft Applications
2 Comments1 Solution390 ViewsLast Modified:
Using information available via a Google search I have put together an Outlook macro to send an email to a list of recipients when a Calendar reminder fires.  The code below works perfectly as long as I don't try to include any attachments that may be present in the Appointment body/details section.  I want the reminder email that this macro generates to also include attachments if they are present in the appointment item.  Can anyone tell me what code I need to add to make this happen?  I have worked/experimented on this issue for many days with no success.  I have finally decided to ask the experts.  (Note that the source object is an AppointmentItem).   Thanks!

Private Sub Application_Reminder(ByVal EventItem As Object)
Dim MailMsg As MailItem
Set MailMsg = Application.CreateItem(olMailItem)
If EventItem.MessageClass = "IPM.Appointment" Then
  Call SendApptMail(MailMsg, EventItem)
End If
Set MailMsg = Nothing
End Sub
Sub SendApptMail(Mail_Item As Object, Appt_Item As Object)
Mail_Item.To = Appt_Item.Location
Mail_Item.Subject = Appt_Item.Subject
Mail_Item.Attachments = Appt_Item.Attachments   'this line throws an error - Help!
Mail_Item.HTMLBody = Appt_Item.Body  'other html formatting omitted for brevity
End Sub

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros