[英]Is there any Event for select text from mail body?
I try to catch selection text change event on mail body. 我尝试在邮件正文上捕获选择文本更改事件。 Idea to get the text when selection changed and show in textbox.
当选择更改时获取文本并显示在文本框中的想法。
I got a document object but is there any event for selection change ? 我有一个文档对象,但是有任何更改选择的事件吗?
Outlook.MailItem mailItem = item as Outlook.MailItem;
Outlook.Inspector inspector = mailItem.GetInspector;
Microsoft.Office.Interop.Word.Document document = (Microsoft.Office.Interop.Word.Document)inspector.WordEditor;
I think you are looking for something similar to this. 我认为您正在寻找与此类似的东西。
Text Selection Change Event in Outlook Inspector Window Outlook Inspector窗口中的文本选择更改事件
You'll want to get the Application
from the Document
and attach to the WindowSelectionChanged
event. 您需要从
Document
获取Application
,并将其附加到WindowSelectionChanged
事件。
Outlook.MailItem mailItem = item as Outlook.MailItem;
Outlook.Inspector inspector = mailItem.GetInspector;
Word.Document document = (Microsoft.Office.Interop.Word.Document)inspector.WordEditor;
Word.Application app = document.Application;
app.WindowSelectionChange += new Microsoft.Office.Interop.Word.ApplicationEvents4_WindowSelectionChangeEventHandler(YOUR_METHOD_HERE);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.