How to find pst filename from outlook 2003 namespaces

  • Thread starter Thread starter christian_A
  • Start date Start date
C

christian_A

I am trying to find the corresponding filename of the personal folders I
have in my Outlook 2003 tree.

How can I find these using VBA ?

Would appreciate if someone have some sample code for that ?

Many thanks in advance for any help

Christian
 
Hi Christian,

for OL 2000 the function GetStorePath returns the fullname of the
pst-file. At the moment I have no OL 2003 installed, but I think that
works to.


Private Function GetHex(ByRef sValue As String) As String
Const sPrä As String = "&h"
GetHex = sPrä & sValue
End Function

Public Function GetStorePath(ByRef sStoreID As String) As String
On Error Resume Next
Const CS_DRIVE As String = ":\"
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, CS_DRIVE)

If lPos Then
GetStorePath = right$(sRes, (Len(sRes)) - (lPos - 2))
End If
End Function
 
Back
Top