In Outlok 2007, you can use Namespace.Stores collection and Store.FilePath /
ExchangeStoreType (=3).
In the older versions of Outlook, MAPI or <plug> Redemption is the way to
go:
skPstAnsi = 1
skPstUnicode = 2
skPrimaryExchangeMailbox = 3
skDelegateExchangeMailbox = 4
skPublicFolders = 5
set Session = CreateObject("Redemption.RDOSession")
Session.Logon
for each Store in Session.Stores
'for i = 1 to Session.Stores.Count
'set Store = Session.Stores(i)
if (Store.StoreKind = skPstAnsi) or (Store.StoreKind = skPstUnicode) Then
Debug.Print Store.PstPath
ElseIf (Store.StoreKind = skPrimaryExchangeMailbox) or (Store.StoreKind =
skDelegateExchangeMailbox) or (Store.StoreKind = skPublicFolders) Then
Debug.Print Store.ServerDN
End If
next
Or you can use ProfMan to direcly read the profile data without havign to
log in:
http://www.dimastr.com/redemption/profiles.htm#example2
<plug>
--
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
-