방법: 받은 편지함에서 읽지 않은 메시지 검색
업데이트: 2007년 11월
적용 대상 |
---|
이 항목의 정보는 지정된 Visual Studio Tools for Office 프로젝트 및 Microsoft Office 버전에만 적용됩니다. 프로젝트 형식
Microsoft Office 버전
자세한 내용은 응용 프로그램 및 프로젝트 형식에 따라 사용 가능한 기능을 참조하십시오. |
이 예제에서는 Outlook 받은 편지함에서 읽지 않은 전자 메일 메시지를 검색하고 항목 수를 표시합니다.
예제
Private Sub ThisAddIn_Startup(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Startup
Dim inbox As Outlook.MAPIFolder = _
Me.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderInbox)
Dim unreadItems As Outlook.Items = _
inbox.Items.Restrict("[Unread]=true")
MessageBox.Show( _
String.Format("Unread items in Inbox = {0}", unreadItems.Count))
End Sub
private void ThisAddIn_Startup(object sender, System.EventArgs e)
{
Outlook.MAPIFolder inbox =
this.Application.Session.GetDefaultFolder
(Outlook.OlDefaultFolders.olFolderInbox);
Outlook.Items unreadItems = inbox.
Items.Restrict("[Unread]=true");
MessageBox.Show(
string.Format("Unread items in Inbox = {0}", unreadItems.Count));
}