PST location of a MAPIFolder

  • Thread starter Thread starter Semut
  • Start date Start date
S

Semut

Hello, how to programatically detect the location of the PST for the
MAPIFolder/Namespace.

thank you.
 
Hi Semut,

the StoreID contains the path info:

Public Function GetPathFromStoreID(sStoreID As String) As String
On Error Resume Next
Dim i As Long
Dim lPos As Long
Dim sRes As String

For i = 1 To Len(sStoreID) Step 2
sRes = sRes & Chr$(GetHex(Mid$(sStoreID, i, 2)))
Next

sRes = Replace(sRes, Chr(0), vbNullString)
lPos = InStr(sRes, ":\")

If lPos Then
GetPathFromStoreID = Right$(sRes, (Len(sRes)) - (lPos - 2))
End If
End Function

Private Function GetHex(sValue As String) As String
GetHex = "&h" & sValue
End Function
 
Make sure you test this in both Outlook 2003 and the prior versions; Outlook
2003 uses Unicode, the prior versions use ANSI.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top