0
我添加自定义属性到Microsoft.Office.Interop.Outlook.MailItem对象,像这样的定制属性:针对一个Outlook互操作的MailItem
Public Const SharePointSiteUrl As String = "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/SharePointSiteUrl"
Public Const SharePointSiteFolder As String = "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/SharePointSiteFolder"
Public Const SharePointSiteUsername As String = "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/SharePointSiteUsername"
Public Const SharePointSitePassword As String = "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/SharePointSitePassword"
...
email.PropertyAccessor.SetProperty(OutlookHelper.SharePointSiteUrl, sharepointSite)
email.PropertyAccessor.SetProperty(OutlookHelper.SharePointSiteFolder, sharepointFolder)
email.PropertyAccessor.SetProperty(OutlookHelper.SharePointSiteUsername, sharepointUserName)
email.PropertyAccessor.SetProperty(OutlookHelper.SharePointSitePassword, sharepointPassword)
四后上面的调用已经被执行,我测试我是否可以使用PropertyAccessor.GetProperty访问属性,并且它们在那里。
然后我使用.SaveAs将电子邮件保存到一个目录。当我后来打开邮件项目和尝试,并访问我收到以下错误性质:
email.PropertyAccessor.GetProperty(SharePointSiteFolder)
The property "http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/SharePointSiteFolder" is unknown or cannot be found.
我没看到那个属性。明天我会放弃它。我没有看到为什么没有理由(除非它在Office 2007 COM中不可用)... – 2011-03-08 19:10:28
工作是一种享受。谢谢一堆。 – 2011-03-09 09:29:19