728x90
반응형
728x170
▶ CustomAddIn.cs
using Microsoft.Office.Interop.Outlook;
using System;
using System.Text;
namespace TestProject
{
/// <summary>
/// 커스텀 애드인
/// </summary>
public partial class CustomAddIn
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Private
//////////////////////////////////////////////////////////////////////////////// Event
#region 커스텀 애드인 시작시 처리하기 - CustomAddIn_Startup(sender, e)
/// <summary>
/// 커스텀 애드인 시작시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void CustomAddIn_Startup(object sender, EventArgs e)
{
MAPIFolder folder = Application.Session.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
Table table = folder.GetTable(string.Empty, OlTableContents.olHiddenItems);
StringBuilder stringBuilder = new StringBuilder();
while(!table.EndOfTable)
{
Row nextRow = table.GetNextRow();
if(nextRow["Subject"] == null)
{
stringBuilder.AppendLine(nextRow["MessageClass"]);
}
else
{
stringBuilder.AppendLine($"{nextRow["Subject"]} : {nextRow["MessageClass"]}");
}
}
System.Windows.Forms.MessageBox.Show(stringBuilder.ToString());
}
#endregion
#region 커스텀 애드인 셧다운시 처리하기 - CustomAddIn_Shutdown(sender, e)
/// <summary>
/// 커스텀 애드인 셧다운시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void CustomAddIn_Shutdown(object sender, EventArgs e)
{
}
#endregion
//////////////////////////////////////////////////////////////////////////////// Function
#region VSTO에서 생성한 코드
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마세요.
/// </summary>
private void InternalStartup()
{
this.Startup += new System.EventHandler(CustomAddIn_Startup );
this.Shutdown += new System.EventHandler(CustomAddIn_Shutdown);
}
#endregion
}
}
728x90
반응형
그리드형(광고전용)
'C# > Outlook' 카테고리의 다른 글
[C#/OUTLOOK] MailItem 인터페이스 : 메일 메시지 헤더 구하기 (0) | 2021.11.16 |
---|---|
[C#/OUTLOOK] FormRegionBase 클래스 : FormRegionShowing 이벤트를 사용해 폼 영역 표시 여부 설정하기 (0) | 2021.10.27 |
[C#/OUTLOOK] Store 인터페이스 : GetDefaultFolder 메소드를 사용해 디폴트 폴더 구하기 (0) | 2021.10.09 |
[C#/OUTLOOK] Account 인터페이스 : 특정 폴더의 계정 구하기 (0) | 2021.10.07 |
[C#/OUTLOOK] Folder 인터페이스 : 전체 폴더 경로를 사용해 폴더 구하기 (0) | 2021.10.07 |
[C#/OUTLOOK] 양식 영역(Form Region) 사용하기 (0) | 2021.10.06 |
[C#/OUTLOOK] 메일 쓰기 창의 메일 본문에서 이벤트 사용하기 (0) | 2021.10.05 |
[C#/OUTLOOK] Inspector 인터페이스 : WordEditor 속성을 사용해 메일 쓰기 창에서 선택 텍스트 구하기 (0) | 2021.10.05 |
[C#/OUTLOOK] Application 인터페이스 : ItemSend 이벤트에서 메일 발송 취소하기 (0) | 2021.10.05 |
[C#/OUTLOOK] Application 인터페이스 : Explorers 속성/ActiveExplorer 메소드 사용하기 (0) | 2021.10.05 |
댓글을 달아 주세요