2012-10-09 30 views
2

我在Access VBA中使用Redemption對象來訪問Outlook。Store.EntryID不同,具體取決於會話登錄方法

DefaultStore.EntryID根據我使用哪個Session logon方法而有所不同。

這裏是我的代碼:

Dim oSession As New Redemption.RDOSession 
oSession.Logon 
Debug.Print oSession.Stores.DefaultStore.EntryID 
oSession.Logoff 
oSession.LogonExchangeMailbox ("MyADUsername"), "mail.server.com" 
Debug.Print oSession.Stores.DefaultStore.EntryID 
oSession.Logoff 
Set oSession = Nothing 

我的第一個Debug.Print返回一個字符串,長約336個字符。第二個Debug.Print返回一個長度大約爲76個字符的不同字符串(與部分相同字符)。

我會在這裏做什麼錯誤或誤解?

回答

1

所有MAPI條目標識必須視爲黑匣子。多個條目ID可以引用同一個對象,所以不應該直接比較條目ID。爲此使用RDOSession.CompareEntryIDs。