2008-10-12 90 views

回答

5

使用Outlook Redemption,您可以使用RDOStores集合迭代VBA中的消息存儲庫,可通過RDOSession.Stores屬性進行訪問。

我期待到做在外面的即裝即用VBA類似的東西的可能性...

編輯:

顯然,路徑PST在STOREID字符串編碼。谷歌打開了this

Sub PstFiles() 
    Dim f As MAPIFolder 

    For Each f In Session.Folders 
    Debug.Print f.StoreID 
    Debug.Print GetPathFromStoreID(f.StoreID) 
    Next f 
End Sub 

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("&h" & 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 

剛剛測試過,可以作爲設計的。

+0

此代碼無需使用Outlook Redemption即可工作。 – Vic 2008-10-13 15:44:22

0

的路徑應該是地方下:

[HKEY_CURRENT_USER \軟件\微軟\的Windows NT \ CURRENTVERSION \ Windows消息 子系統\ Profiles文件\展望]

也許這有點幫助。