2008-10-12 36 views

Respuesta

5

Con Outlook Redemption, puede iterar los almacenes de mensajes en VBA utilizando la colección RDOStores, accesible a través de la propiedad RDOSession.Stores.

Estoy buscando en la posibilidad de hacer algo similar en fuera-de-la-caja de VBA ...

EDIT:

Obviamente, el camino hacia el PST está codificada en la cadena StoreID. Google se presentó 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 

Sólo probado, funciona como fue diseñado.

+0

Este código funciona sin tener que usar el canje de Outlook. – Vic

+1

La conveniencia de Redemption es que expone explícitamente la propiedad RDOPstStore.PstPath (http://www.dimastr.com/redemption/rdostore.htm#RDOPstStore) sin tener que hackear la identificación de entrada de la tienda. –

0

La ruta debe estar en algún lugar en:

[HKEY_CURRENT_USER \ Software \ Microsoft \ Windows NT \ CurrentVersion \ Windows Messaging Subsystem \ Profiles \ Outlook]

Tal vez esto ayude un poco .

Cuestiones relacionadas