Outlook 2007 插件

发布于 2024-07-30 09:03:34 字数 407 浏览 2 评论 0原文

我即将开始使用我的第一个 Outlook 2007 插件。

我想创建一个新的工具栏,其中有一个最初被禁用的按钮。

当用户选择一条消息时,应该启用该按钮...但前提是该电子邮件属于某种类型的电子邮件...

这是我需要您的专家建议的地方,有没有一种方法可以在 Outlook 中快速标记电子邮件,这样,在电子邮件选择事件中,您可以查找该电子邮件的属性...

例如...

on_select 如果 mail.type = "FromISP" 那么

我宁愿不使用 from 字段....

另一件事是在发送过程中我需要设置标志,我使用 .net 再次执行此操作,以便我拥有完全控制权关于邮件的创建方式。

任何想法都会有所帮助...

谢谢

I am about to embark on my first outlook 2007 plugin.

I would like to create a new tool bar that will have a button that will initially be disabled.

When the user selects a message the button should be enabled... but only if the email is of a certain type of email...

This is where I need your expert advice, is there a way to quickly flag an email in outlook, so that in the email select event you can look for a property of that email...

for example...

on_select
if mail.type = "FromISP" then

I would prefer not to use the from field....

the other thing is during the send process I need to set the flag, I am doing this again using .net so I have full control over how the mail is created.

Any ideas would help...

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ˇ宁静的妩媚 2024-08-06 09:03:34

您可以连接 Application.ActiveExplorer().SelectionChange 事件,然后查看该集合中的项目(因为用户可能会选择多个对象)。 如果您只想仅在选择一项测试时启用按钮,或者您只想跟踪 MessageClass 的邮件消息测试。
然后将该项目转换为 MailItem,您可以在其中看到它的所有属性。

对于发送使用 Application.ItemSend 事件,我认为它会完成这项工作..(我倾向于将检查器包装成我自己..)然后您可以在此处设置您的“标志”。 设置标志..我建议在该项目上使用用户属性。

更新

在发送事件上添加用户属性 发送至电子邮件。

    UserProperty myprop = myItem.UserProperties.Add("MyPropName", olText);
    myprop.Value = "FlagOn" ;

然后在您的选择事件中通过查找用户属性来测试您的标志。 许多人使用邮件项目的里程或账单字段来存储标记,这很简单,但是,如果您运行其他插件或表单,您会发现它们也可能使用它们并导致问题。

更新 2

好的...我认为可行的方法是在 ASP 生成代码中添加 X 标头,然后使用属性访问器查看 Addin 中的电子邮件标头进行测试。

You can wire up the on Application.ActiveExplorer().SelectionChange event, then look at the items in that collection (as the user may select more that one object). If you just want to enable your button only when one item is selected test for it, also if you just want to track Mail messages test for the MessageClass.
Then cast the item into a MailItem where you can see all it properties.

For the send use Application.ItemSend event i think it will do the job .. (I tend to wrap the inspector my self.. ) You can then set your "flag" here. Setting a flag .. I would suggest using a userproperty on the item.

Update

On the send event add a userproperty to the email.

    UserProperty myprop = myItem.UserProperties.Add("MyPropName", olText);
    myprop.Value = "FlagOn" ;

Then in your selection event test for your flag by looking up the userproperty. Many people use the Mileage or Billing Fields of the Mailitem to store flags its simple but, if you run other addins or forms you find that they may use them as well and cause problems.

Update 2

Ok ... I think the way to go would be to add an X header in the ASP generation code then test for that looking at the email headers in your Addin using property accessors.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文