Advertisement
Guest User

THISOUTLOOKSESSION

a guest
Apr 26th, 2017
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. Private WithEvents olRemind As Outlook.Reminders
  3.  
  4. Private Sub Application_Startup()
  5.   CreateAppointment
  6. End Sub
  7.  
  8. Private Sub Application_Reminder(ByVal Item As Object)
  9. Set olRemind = Outlook.Reminders
  10.  
  11. If Item.MessageClass <> "IPM.Appointment" Then
  12.   Exit Sub
  13. End If
  14.  
  15. If Item.Categories <> "Run in 5" Then
  16.   Exit Sub
  17. End If
  18.  
  19. ' Call macro
  20.  
  21. 'Delete appt from calendar when finished
  22. Item.Delete
  23.  
  24. ' Create another appt to repeat the process
  25. CreateAppointment
  26.  
  27. End Sub
  28.  
  29. ' dismiss reminder
  30. Private Sub olRemind_BeforeReminderShow(Cancel As Boolean)
  31.  
  32.     For Each objRem In olRemind
  33.             If objRem.Caption = "This Appointment reminder fires in 5" Then
  34.                 If objRem.IsVisible Then
  35.                     objRem.Dismiss
  36.                     Cancel = True
  37.                 End If
  38.                 Exit For
  39.             End If
  40.         Next objRem
  41. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement