![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
I'm getting an error on this Code Line of the 1st case:
objMsg.To = Item.To I want to be able to email all those Scehduled for a meeting off the reminder notice. It works if I give it an Email string, it just will not return the original To. If it does not store them, is there a work around to get them. Private Sub Application_Reminder(ByVal Item As Object) Dim objMsg As MailItem ' create new outgoing message Set objMsg = Application.CreateItem(olMailItem) ' your reminder notification address objMsg.Subject = "Reminder: " & Item.Subject ' must handle all 4 types of items that can generate reminders Select Case Item.Class Case olAppointment '26 objMsg.To = Item.To objMsg.Body = _ "Start: " & Item.Start & vbCrLf & _ "End: " & Item.End & vbCrLf & _ "Location: " & Item.Location & vbCrLf & _ "Details: " & vbCrLf & Item.Body Case olContact '40 objMsg.Body = _ "Contact: " & Item.FullName & vbCrLf & _ "Phone: " & Item.BusinessTelephoneNumber & vbCrLf & _ "Contact Details: " & vbCrLf & Item.Body Case olMail '43 objMsg.Body = _ "Due: " & Item.FlagDueBy & vbCrLf & _ "Details: " & vbCrLf & Item.Body Case olTask '48 objMsg.Body = _ "Start: " & Item.StartDate & vbCrLf & _ "End: " & Item.DueDate & vbCrLf & _ "Details: " & vbCrLf & Item.Body End Select ' send the message objMsg.Send Set objMsg = Nothing End Sub |
#2
|
|||
|
|||
![]()
You can't use Item.To because the passed item object could be an Appointment,
Task, Contact or Mail Item - whatever the reminder was set on. Only MailItem supports a To property. -- Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "john" wrote: I'm getting an error on this Code Line of the 1st case: objMsg.To = Item.To I want to be able to email all those Scehduled for a meeting off the reminder notice. It works if I give it an Email string, it just will not return the original To. If it does not store them, is there a work around to get them. Private Sub Application_Reminder(ByVal Item As Object) Dim objMsg As MailItem ' create new outgoing message Set objMsg = Application.CreateItem(olMailItem) ' your reminder notification address objMsg.Subject = "Reminder: " & Item.Subject ' must handle all 4 types of items that can generate reminders Select Case Item.Class Case olAppointment '26 objMsg.To = Item.To objMsg.Body = _ "Start: " & Item.Start & vbCrLf & _ "End: " & Item.End & vbCrLf & _ "Location: " & Item.Location & vbCrLf & _ "Details: " & vbCrLf & Item.Body Case olContact '40 objMsg.Body = _ "Contact: " & Item.FullName & vbCrLf & _ "Phone: " & Item.BusinessTelephoneNumber & vbCrLf & _ "Contact Details: " & vbCrLf & Item.Body Case olMail '43 objMsg.Body = _ "Due: " & Item.FlagDueBy & vbCrLf & _ "Details: " & vbCrLf & Item.Body Case olTask '48 objMsg.Body = _ "Start: " & Item.StartDate & vbCrLf & _ "End: " & Item.DueDate & vbCrLf & _ "Details: " & vbCrLf & Item.Body End Select ' send the message objMsg.Send Set objMsg = Nothing End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Which event is triggered when user saves email item? | Kasper | Add-ins for Outlook | 4 | September 22nd 06 03:26 PM |
Can I get Outlook 2003 to send an email triggered by an event | Greg Wardlaw | Outlook - Calandaring | 1 | September 1st 06 03:23 PM |
read event not triggered | Willem Peper | Outlook and VBA | 1 | June 13th 06 07:03 AM |
Email appointment reminder | Josh Prowse | Outlook - General Queries | 2 | March 17th 06 03:03 AM |
Events not always triggered | Jim Burke in Novi | Outlook and VBA | 1 | January 30th 06 07:36 AM |