VSTO OUTLOOK:获取刚刚在“ to”“ BC”中输入的最后一封电子邮件地址或“ CC”新的字段,回复或向前窗口
我正在尝试将最后一个收件人(电子邮件地址)引入刚刚引入“ TO”,“ BC”或“ CC”字段时。我该如何实现?
例如:
- 如果用户只是在“到”字段中的电子邮件地址中键入我想获得的字段。
- 如果用户只是在“ BC”字段中输入电子邮件地址,我想获得。
- 如果用户只是在“ CC”字段中输入电子邮件地址,我想获得。
I am trying to get the last recipient (email address) just introduced into the "To", "Bc" or "Cc" fields when field loses its focus. How can I achieve this?
For example:
- if user just types in an email address within "To" field I want to get that.
- if user just types in an email address within "Bc" field I want to get that.
- if user just types in an email address within "Cc" field I want to get that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用
mailItem.propertychange
事件。每当更改任何收件人(添加/删除)时,事件处理程序将对所有3个(TO/cc/bcc)属性发射,因此您将不知道哪一个更改。您需要先缓存旧值,当事件启动时,将其与新值进行比较。Use
MailItem.PropertyChange
event. Whenever any recipient is changed (added/deleted), the event handler fires for all 3 (To/CC/BCC) properties, so your won't know which one changed. You'd need to cache the old value first, and when the event fires, compare it with new value.您可以处理 mailitem.propertyChange当对象的明确内置属性(例如,
主题
)被更改时,它会发射。属性名称传递给事件,以便您可以确定哪个属性已更改。收件人
属性返回a /a>集合,代表Outlook项目的所有收件人。因此,您可以轻松获得TO,CC或BCC字段的物品。You can handle the MailItem.PropertyChange event which is fired when an explicit built-in property (for example,
Subject
) of the object is changed. The property name is passed to the event so that you can determine which property was changed.The
Recipients
property returns a Recipients collection that represents all the recipients for the Outlook item. So, you could get easily get the items for the To, Cc or Bcc fields.