728x90
반응형
728x170
C#,OUTLOOK,INSPECTOR
using Microsoft.Office.Interop.Outlook;
Application application = Globals.CustomAddIn.Application;
Inspector inspector = application.ActiveInspector();
MailItem mailItem = inspector.CurrentItem as MailItem;
if(mailItem != null)
{
if(inspector.EditorType == OlEditorType.olEditorWord && inspector.IsWordMail())
{
Microsoft.Office.Interop.Word.Document document = inspector.WordEditor;
if(document != null)
{
document.Application.WindowBeforeDoubleClick += application_WindowBeforeDoubleClick;
}
}
}
#region 애플리케이션 윈도우 더블 클릭 전 처리하기 - application_WindowBeforeDoubleClick(selection, cancel)
/// <summary>
/// 애플리케이션 윈도우 더블 클릭 전 처리하기
/// </summary>
/// <param name="selection">선택</param>
/// <param name="cancel">취소 여부</param>
private void application_WindowBeforeDoubleClick(Microsoft.Office.Interop.Word.Selection selection, ref bool cancel)
{
Microsoft.Office.Interop.Word.Words words = selection.Words;
System.Windows.Forms.MessageBox.Show($"선택 문자열 : {words.First.Text}");
}
#endregion
※ 비주얼 스튜디오의 [참조 관리자] 대화 상자의 어셈블리/확장에서 Microsoft.Office.Interop.Word 항목을 참조한다.
728x90
반응형
그리드형(광고전용)
'C# > Outlook' 카테고리의 다른 글
[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] Inspector 인터페이스 : WordEditor 속성을 사용해 메일 쓰기 창에서 선택 텍스트 구하기 (0) | 2021.10.05 |
[C#/OUTLOOK] Application 인터페이스 : ItemSend 이벤트에서 메일 발송 취소하기 (0) | 2021.10.05 |
[C#/OUTLOOK] Application 인터페이스 : Explorers 속성/ActiveExplorer 메소드 사용하기 (0) | 2021.10.05 |
[C#/OUTLOOK] Application 인터페이스 : Inspectors 속성/ActiveInspector 메소드 사용하기 (0) | 2021.10.05 |
[C#/OUTLOOK] Attachment 인터페이스 : PropertyAccessor 속성을 사용해 첨부 파일 표시 여부 설정하기 (0) | 2021.08.11 |
댓글을 달아 주세요