R
rimmer59
I have typed in the following but get an error at oEmail.Send. This code was
for an earlier version of Outlook. What do you do now for the 2003 version?
Regards, Tim
Private Sub Application_Reminder(ByVal Item As Object)
If Item.Sensitivity <> olConfidential Then
If TypeOf Item Is AppointmentItem Then SendApptReminder Item
If TypeOf Item Is MailItem Then SendMailReminder Item
If TypeOf Item Is TaskItem Then SendTaskReminder Item
End If
End Sub
Private Sub SendApptReminder(ByRef Item As AppointmentItem)
SendPage Item.Subject, FormatDateTime(Item.Start, vbShortTime) & _
"-" & FormatDateTime(Item.End, vbShortTime) & vbCrLf & _
Item.Location
End Sub
Private Sub SendMailReminder(ByRef Item As MailItem)
SendPage "Mail Reminder", Item.Subject
End Sub
Private Sub SendTaskReminder(ByRef Item As TaskItem)
SendPage Item.Subject, Item.Body
End Sub
Private Sub SendPage(ByRef Subject As String, ByRef Body As String)
Dim oEmail As Object
Set oEmail = Application.CreateItem(olMailItem)
oEmail.Subject = Subject
oEmail.Body = Body
oEmail.Recipients.Add "Pager For Reminders"
oEmail.Send
End Sub
for an earlier version of Outlook. What do you do now for the 2003 version?
Regards, Tim
Private Sub Application_Reminder(ByVal Item As Object)
If Item.Sensitivity <> olConfidential Then
If TypeOf Item Is AppointmentItem Then SendApptReminder Item
If TypeOf Item Is MailItem Then SendMailReminder Item
If TypeOf Item Is TaskItem Then SendTaskReminder Item
End If
End Sub
Private Sub SendApptReminder(ByRef Item As AppointmentItem)
SendPage Item.Subject, FormatDateTime(Item.Start, vbShortTime) & _
"-" & FormatDateTime(Item.End, vbShortTime) & vbCrLf & _
Item.Location
End Sub
Private Sub SendMailReminder(ByRef Item As MailItem)
SendPage "Mail Reminder", Item.Subject
End Sub
Private Sub SendTaskReminder(ByRef Item As TaskItem)
SendPage Item.Subject, Item.Body
End Sub
Private Sub SendPage(ByRef Subject As String, ByRef Body As String)
Dim oEmail As Object
Set oEmail = Application.CreateItem(olMailItem)
oEmail.Subject = Subject
oEmail.Body = Body
oEmail.Recipients.Add "Pager For Reminders"
oEmail.Send
End Sub