Sub SnoozedReminders()
' http://www.jpsoftwaretech.com/check-your-outlook-reminders-in-vba/
Dim MyReminder As Outlook.Reminder
Dim MyReminders As Outlook.Reminders
Dim Report As String
Dim i As Long
Set MyReminders = Outlook.Reminders
i = 0
For Each MyReminder In MyReminders
If HasReminderFired(MyReminder) = True Then
i = i + 1
Report = Report & i & ": " & MyReminder.Caption & vbCr & _
" Snoozed to " & MyReminder.NextReminderDate & vbCr & vbCr
End If
Next MyReminder
CreateReportAsEmail "Snoozed Items", Report
End Sub
Function HasReminderFired(rmndr As Outlook.Reminder) As Boolean
HasReminderFired = (rmndr.OriginalReminderDate <> rmndr.NextReminderDate)
End Function
' VBA SubRoutine which displays a report inside an email
' Programming by Greg Thatcher, http://www.GregThatcher.com
Public Sub CreateReportAsEmail(Title As String, Report As String)
On Error GoTo On_Error
Dim Session As Outlook.Namespace
Dim mail As MailItem
Dim MyAddress As AddressEntry
Dim Inbox As Outlook.folder
Set Session = Application.Session
Set Inbox = Session.GetDefaultFolder(olFolderInbox)
Set mail = Inbox.items.Add("IPM.Mail")
mail.Subject = Title
mail.Body = Report
mail.Save
mail.Display
Exiting:
Set Session = Nothing
Set Inbox = Nothing
Set mail = Nothing
Exit Sub
On_Error:
MsgBox "error=" & Err.Number & " " & Err.Description
Resume Exiting
End Sub
VBA에 익숙하지 않은 경우 Slipstick 's description page를 참조하십시오 . 다음에 대한 정보를 찾을 수 있습니다.
- 매크로 보안 설정;
- 코드를 넣을 위치 (삽입 | 모듈과 함께 일반 모듈을 사용할 수 있음); 과
- 버튼을 만드는 방법.