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