PST OUTLOOK

cs_eldim Messages postés 956 Date d'inscription lundi 30 mai 2005 Statut Membre Dernière intervention 21 août 2014 - 18 janv. 2006 à 12:10
ricomiracle Messages postés 195 Date d'inscription vendredi 19 novembre 2004 Statut Membre Dernière intervention 30 novembre 2009 - 28 août 2009 à 17:39
Bonjour,

Est-ce quelqu'un sait comment récupérer le chemin du fichier pst d'outlook de l'utilisateur en cours ?

(Sachant que ce chemin est paramétrable dans outlook...)

2 réponses

ricomiracle Messages postés 195 Date d'inscription vendredi 19 novembre 2004 Statut Membre Dernière intervention 30 novembre 2009
25 août 2009 à 17:26
Bonjour,

Je cherche à faire la même chose alors si tu as trouvé la solution...
0
ricomiracle Messages postés 195 Date d'inscription vendredi 19 novembre 2004 Statut Membre Dernière intervention 30 novembre 2009
28 août 2009 à 17:39
Pour ceux qui tomberaient sur ce post, il y a un code sur outlook-code.com:
Il faut récupérer un objet MAPIfolder puis envoyer la propriété storeID de cet objet à la fonction GetStorePath

'This function retrieve the fileName of a PST
'from the storeID of a MAPIfolder
Public Function GetStorePath(ByRef sStoreID As String) As String
On Error Resume Next
Const CS_DRIVE As String = ":"
Const CS_UNC 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))
Else
lPos = InStr(sRes, CS_UNC)
If lPos Then
GetStorePath = Right$(sRes, (Len(sRes)) - (lPos - 2))
Else
GetStorePath = vbNullString ' not found
End If
End If

End Function

Private Function GetHex(ByRef sValue As String) As String
Const sHex As String = "&h"
GetHex = sHex & sValue
End Function
0
Rejoignez-nous