Outlook 2007中邮件项的自定义图标 [英] Custom Icon for Mail Item in Outlook 2007
问题描述
我正在尝试更改MailItem的图标(在资源管理器中)使用以下代码的Outlook 2007:
MailItem mailItem = Globals.AddinManager.Application.ActiveExplorer()。选择[1]
as MailItem;
mailItem.PropertyAccessor.SetProperty( " http://schemas.microsoft.com/mapi/proptag/0x10800003" , - 1);
mailItem.FormDescription.Icon = @" C:\ logo.ico" ;
mailItem.FormDescription.MiniIcon =
mailItem.Save();
但是图标没有变化,也没有任何例外。
任何人都可以建议,这个代码有什么问题?
我的观察结果是:PR_ICON_INDEX = -1的值导致0XFFFFF,这是未读邮件的值。
我尝试过还有其他负值但是没有用。
我不想用自定义表格或表格区域等更改图标。
无论如何都有我们可以更改MailItem的图标。
提前感谢您的帮助。
感谢和致以诚挚的问候,为Nikhil Sharma
而不是-1尝试将1作为最后一个参数传递给SetProperty调用,看看是否有效。
<下面url上的外部线程似乎有相同的解决方案
http://help.wugnet.com/office/Change-MiniIcon-message-ftopict1079523.html
<登记/>谢谢,
那伏乃尔
Hi,
I am trying to change icon of the MailItem (in explorer) in Outlook 2007 by using code below:
MailItem mailItem = Globals.AddinManager.Application.ActiveExplorer().Selection[1]
as MailItem;
mailItem.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/proptag/0x10800003", -1);
mailItem.FormDescription.Icon = @"C:\logo.ico";
mailItem.FormDescription.MiniIcon = @"C:\logo.ico";
mailItem.Subject = mailItem.Subject;
mailItem.Save();
but icon is not changing and it is also not giving any exception.
can anybody please suggest, what is wrong in this code?
My observations are : value of PR_ICON_INDEX = -1 leads to 0XFFFFF which is value for unread mail.
i tried with other negative values as well but it didn't work.
I don't want to change icons with custom forms or form region's etc.
Is there anyway by which we can change icon of the MailItem.
Thanks in advance for your help.
Thanks and Best Regards,
Nikhil Sharma
Instead of -1 try to pass 1 as the last parameter to SetProperty call and see if that works.
An external thread on below url seems to have the same solution
http://help.wugnet.com/office/Change-MiniIcon-message-ftopict1079523.html
Thanks,
Navneet
这篇关于Outlook 2007中邮件项的自定义图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!