728x90
반응형
728x170
▶ CustomControl.cs
using System;
using System.Windows.Forms;
namespace TestProject
{
/// <summary>
/// 커스텀 컨트롤
/// </summary>
public partial class CustomControl : UserControl
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - CustomControl()
/// <summary>
/// 생성자
/// </summary>
public CustomControl()
{
InitializeComponent();
this.testButton.Click += testButton_Click;
}
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 테스트 버튼 클릭시 처리하기 - testButton_Click(sender, e)
/// <summary>
/// 테스트 버튼 클릭시 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void testButton_Click(object sender, EventArgs e)
{
MessageBox.Show("테스트 메시지 입니다.");
}
#endregion
}
}
▶ CustomAddIn.cs
using Microsoft.Office.Tools;
using System;
namespace TestProject
{
/// <summary>
/// 커스텀 애드인
/// </summary>
public partial class CustomAddIn
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Field
////////////////////////////////////////////////////////////////////////////////////////// Private
#region Field
/// <summary>
/// 커스텀 컨트롤
/// </summary>
private CustomControl customControl;
/// <summary>
/// 커스텀 태스크 창
/// </summary>
private CustomTaskPane customTaskPane;
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// 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)
{
this.customControl = new CustomControl();
this.customTaskPane = CustomTaskPanes.Add(this.customControl, "테스트 태스크 창");
this.customTaskPane.Visible = true;
}
#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] 현재 사용자명 구하기 (0) | 2021.06.16 |
---|---|
[C#/OUTLOOK] Folder 인터페이스 : 받은 편지함 폴더 구하기 (0) | 2021.06.16 |
[C#/OUTLOOK] ContactItem 인터페이스 : 연락처 항목 찾기 (0) | 2021.06.16 |
[C#/OUTLOOK] _Application 인터페이스 : CreateItem 메소드를 사용해 약속 항목 만들기 (0) | 2021.06.15 |
[C#/OUTLOOK] ContactItem 인터페이스 : 연락처 항목 찾기 (0) | 2021.06.15 |
[C#/OUTLOOK] _Application 인터페이스 : CreateItem 메소드를 사용해 연락처 항목 만들기 (0) | 2021.06.15 |
[C#/OUTLOOK] Folder 인터페이스 : 사용자 지정 폴더 항목 만들기 (0) | 2021.06.15 |
[C#/OUTLOOK] _Application 인터페이스 : CreateItem 메소드를 사용해 메일 항목 만들기 (0) | 2021.06.15 |
[C#/OUTLOOK] RibbonButton 인터페이스 : 커스텀 버튼 추가하기 (0) | 2021.06.15 |
[C#/OUTLOOK] Inspectors 인터페이스 : NewInspector 이벤트를 사용해 신규 메일 작성시 제목/본문 텍스트 설정하기 (0) | 2021.06.14 |
[C#/OUTLOOK] CustomTaskPane 인터페이스 : 커스텀 컨트롤 추가하기 (0) | 2021.06.14 |
댓글을 달아 주세요