Store.FilePath Property

Status
Not open for further replies.

GeoffG

New Member
Outlook version
Outlook 2010 32 bit
Email Account
IMAP
QUESTIONS:

1. Why does the Store.FilePath property return a zero-length string when the store is used by an IMAP email address?

2. Is there a VBA property that will reveal the full hard-disc path for the PST file for a Gmail account?


MY SETUP:

I set up a Gmail email account in Microsoft Outlook 2010 on a Windows 10 computer:

This created a PST file on my hard disc.

The path to the PST file can be seen in two Outlook windows:

PATH TRUNCATED HERE:
File > Account Settings > Account Settings > Email Tab

FULL PATH HERE:
File > Account Settings > Account Settings > Data Files Tab > Settings


Very many thanks.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
It should get the path... but when i run this macro, it gets the exchange ost path but not gmail. I'll see if there is another way to get the path (will likely use Redemption) and find out if this is a bug.

Code:
Option Explicit

Private Sub GetDataFilePaths()
    Dim oStores As Outlook.Stores
    Dim oStore As Outlook.Store
  
    Set oStores = Application.Session.Stores

    For Each oStore In oStores

          Debug.Print oStore.DisplayName, oStore.FilePath

    Next

Set oStores = Nothing
Set oStore = Nothing
End Sub
 
Last edited:

GeoffG

New Member
Outlook version
Outlook 2010 32 bit
Email Account
IMAP
Very many thanks for your reply.
I was using similar code.
Strange that the path is returned for POP accounts, but not IMAP accounts.
I hope you get somewhere with it and I'll look out for any further replies.
Thanks again.
Geoff
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
Yeah, its weird... best guess it has something to do with the change from pst files to ost files for imap accounts. Still waiting to hear from my contacts on why its not working.

I tried using this macro with redemption and it does not return the imap account. If i use skIUnknown, it returns it.

Code:
Sub testpath()
Set rdo = CreateObject("Redemption.RDOSession")

rdo.Logon


For Each Store In rdo.Stores
  If (Store.StoreKind = skPstAnsi) Or (Store.StoreKind = skPstUnicode) Then
    Debug.Print Store.Name & " - " & Store.PstPath
  ElseIf (Store.StoreKind = skPrimaryExchangeMailbox) Then
    Debug.Print Store.Name & " - " & Store.OSTPath
  ElseIf (StoreKind = skIMAP4) Then
    
    Debug.Print Store.Name & " - " & "IMAP"

  End If
Next


End Sub
 

GeoffG

New Member
Outlook version
Outlook 2010 32 bit
Email Account
IMAP
Many thanks for your reply.

I made a slight change to your code (copying your examples).

I found the Store.PSTPath property returned the path to the PST files storing data for the gmail accounts.

Sorry, I'm afraid I don't understand the significance of your comment that the macro does not work with Redemption - it did for me.

If the macro is not working for you (but is for me), then perhaps there are Outlook setup differences that I'm unaware of? Mine is a standalone computer running Microsoft Office 2010.

Anyway - thank you very much indeed.
I think my problem is solved.


Code:
Sub testpath()

    Dim RDO As Redemption.RDOSession
    Dim Store As Redemption.RDOStore

    Set RDO = CreateObject("Redemption.RDOSession")
    RDO.Logon

    For Each Store In RDO.Stores
      If (Store.StoreKind = skPstAnsi) Or (Store.StoreKind = skPstUnicode) Then
        Debug.Print Store.Name & " - " & Store.PstPath
      ElseIf (Store.StoreKind = skPrimaryExchangeMailbox) Then
        Debug.Print Store.Name & " - " & Store.OstPath
      ElseIf (Store.StoreKind = skIMAP4) Then
        Debug.Print Store.Name & " - " & "IMAP"
        
        ' Geoff added this:
        ' The following code line returns the hard-disc
        ' path to the PST file that stores gmail emails:
        Debug.Print Store.Name & " - " & Store.PstPath
        
      End If
    Next
    
    RDO.Logoff
    Set RDO = Nothing

End Sub
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M Convertor for Outlook Express Mail Store (.dbx) to Outlook Mail Store (.pst) Using Outlook 0
David Langer Store my Outlook settings in the cloud - Broken Using Outlook 4
R "Can't store Outlook data files under the AppData folder. Please choose another folder." Using Outlook 6
R Can not create folder to store specific emails in in Outlook for Mac Using Outlook 1
Diane Poremsky The Best Outlook Store Add-ins Contest Using Outlook 0
Diane Poremsky Can you store a pst file on an SD card? Using Outlook 0
V Installing Apps from MS Online Store Using Outlook 5
T Importing OE6 e-mail to Outlook via Store Folder Using Outlook 9
A Exception message: MapiExceptionLogonFailed: Unable to open message store Exchange Server Administration 1
J iCloud Calendar/Contacts Syncing Hangs At End - aplzod Data Store Not Created Using Outlook 8
J Problems starting Information Store Server in Exchange 2003 Exchange Server Administration 13
D Where does Outlook store signatures? Outlook VBA and Custom Forms 9
E Where is the best place to store values for combobox entries Outlook VBA and Custom Forms 5
E Where is the best place to store values for combobox entries Outlook VBA and Custom Forms 5
E How do I change the display name of a .pst store Outlook VBA and Custom Forms 5
E How do I change the display name of a .pst store Outlook VBA and Custom Forms 5
J Where does BCM store User-Defined fields in the database? BCM (Business Contact Manager) 3
Q How outlook Store Appointment Outlook VBA and Custom Forms 1
S Visual indicator of a certain property or to show a macro toggle Outlook VBA and Custom Forms 2
D Outlook VBA error extracting property data from GetRules collection Outlook VBA and Custom Forms 10
W Appointment occurrences change the location property Using Outlook 0
oliv- property "is printed" or catching print events Outlook VBA and Custom Forms 2
B Assistance with Deprecated .Links Property Outlook VBA and Custom Forms 2
JorgeDario ¿What property of mailitem can be used like primary key? Outlook VBA and Custom Forms 6
M Accessing ExpiryTime property Outlook VBA and Custom Forms 1
M How to automatically refresh an appointment windows after changing the MessageClass property ? Outlook VBA and Custom Forms 4
R Vba Conversation Index property Using Outlook 0
H Calendar Folder property is empty Using Outlook 1
G run-time 438: object doesn't support this property or method Using Outlook 2
Commodore Calendar Folder property is missing - Event 27 Using Outlook 11
B Update Item.Subject property Using Outlook 1
S Custom property/functionality not stored when I publish to a Public Folder Using Outlook 7
T You must Provide a value for this property on powershell cmdlet Exchange Server Administration 3
S Saved Property of MailItem is copied Outlook VBA and Custom Forms 1
M MailItem object has no property for when a reply was sent Outlook VBA and Custom Forms 3
D Using the CurrentFolder property Outlook VBA and Custom Forms 3
S Property pages in Outlook 2010 Outlook VBA and Custom Forms 1
M Can't create new user property? Outlook VBA and Custom Forms 10
S Xref type property in an email header? Outlook VBA and Custom Forms 6
W Setting PR_CREATION_TIME property? Outlook VBA and Custom Forms 1
D Item Property CHange Outlook VBA and Custom Forms 4
W Using a PropertyAccessor custom datetime property in Views Outlook VBA and Custom Forms 3
J How do I access the AssignedTo property in an outlook 2007 task? Outlook VBA and Custom Forms 7
S User property for folder Outlook VBA and Custom Forms 2
T Setting a MAPI property of type PT_SYSTIME Outlook VBA and Custom Forms 4
E Displayname of User Property Outlook VBA and Custom Forms 7
E Displayname of User Property Outlook VBA and Custom Forms 7
M Obtain property value by name Outlook VBA and Custom Forms 5
M Can't change autoarchive property in Deleted Items folder BCM (Business Contact Manager) 1
C How do I grab a field property (like .value) so I can modify it via OL code? Outlook VBA and Custom Forms 4

Similar threads

Top