Link to home
Start Free TrialLog in
Avatar of Michel_Henrotay
Michel_Henrotay

asked on

Accessing programatically the pst file name from the Outlook object

Using the Outlook automation object, it is possible to access all the objects, except one: the name of the pst file undelying a personnel folder.
Does anybody have an idea how to do that?
Avatar of stefri
stefri
Flag of France image

This could be acces from CDO in infostores collections

Sub getStores()
Dim objSession As MAPI.Session
Dim objInfoStoresColl As InfoStores
Dim objInfoStore As InfoStore
Dim infS As InfoStore

Set objSession = CreateObject("MAPI.Session")
objSession.Logon
' assume valid Session object

Set objInfoStoresColl = objSession.InfoStores
If objInfoStoresColl Is Nothing Then

    MsgBox "Could not set InfoStores collection"
    Exit Sub
End If
If 0 = objInfoStoresColl.Count Then
    MsgBox "No InfoStores in the collection"
    Exit Sub
End If
For Each infS In objInfoStoresColl

' could be objInfoStoresColl(collIndex) since Item is default property
If infS Is Nothing Then
    MsgBox "Cannot get first InfoStore object"
    Set objInfoStoresColl = Nothing
    Exit Sub
Else
    MsgBox "Selected InfoStores item " & infS.Name
End If

Set infS = Nothing
Next
Set objInfoStoresColl = Nothing
End Sub
Avatar of Michel_Henrotay
Michel_Henrotay

ASKER

I will try it and report back whever or not I am succesful.
There is no solution using the Outlook object?
I have the CDO object, but not the help files. Where can I find that?
I have tried the solution offered by stefri, but we are far from my expectation.
The collection "objSession.InfoStores" is similar to the equivalent with the Outlook  "namespace.folders"  which list all the Mapifolders in the profile. The Mapifolder object has no property that gives the operating system name of the corresponding pst file.
I need a work around.
There is a solution that involves registry access, the problem, Microsoft has "Hard coded" it by using Physical addresses, which makes any use of this information very risky, At any time Microsoft might change it without notice.
ASKER CERTIFIED SOLUTION
Avatar of stefri
stefri
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Buy tyhe way I found it my self, but you deserve the points
Thanks
Michel,
you are grading low as you state yourself that I deserve the points...
Sorry,
I did not think that this was low grading.
If you want, I can grade you higher, just tell me how?
I also have a lot of points. Too much for my requirements.
By the way, you seems to be very knowledgeable concerning the Outlook object model. Is this how you are making a living?
I am myself heavily involved in the Outlook model. Maybe we can exchange some ideas outside this forum. My email address is michel_henrotay2000@yahoo.com