Create a list of all folder tree of as huge 45 PST file

Page 2 of 3 FirstFirst 123 LastLast

  1. Posts : 16,948
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #11

    Samuria said:
    Why not just delete the ost file it will then be rebuilt next time as ost is storred on the server and updated on the pc unlike pst which is all on the pc
    The OP is trying to get a list of the contents rather than recover them [which is what I think you are addressing].

    Denis
      My Computer


  2. Posts : 56,826
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #12

    TreeSize Free does a nice job of that. I just did a sample from some Office stuff in my Appdata, and exported it to a PDF. Nice tree structure. What's shown can be customized.

    Create a list of all folder tree of as huge 45 PST file-2019-05-17_20h38_37.pngTreeSize Free Export.pdf

    TreeSize Free - Quickly Scan Directory Sizes and Find Space Hogs
      My Computers


  3. Posts : 16,948
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #13

    f14tomcat said:
    TreeSize Free does a nice job of that
    What "that" are you referring to? The OP is trying to list the folders within a pst file. Treesize cannot see inside files.

    Denis
      My Computer


  4. Posts : 56,826
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #14

    Try3 said:
    What "that" are you referring to? The OP is trying to list the folders within a pst file. Treesize cannot see inside files.

    Denis
    Didn't interpret it that way. I saw it as wanting a list of the folders and their nested folders/files. Not the actual contents/data in the files, so there would no need to see inside the files as you stated. On looking back, this is just what Steve C posted also, and I didn't see that at first. Your VBS script lists the folders/files, also, from what I see. How is that different? Does it output the actual content of the files?

    The "that" is the subject of the OP's first post.
      My Computers


  5. Posts : 16,948
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #15

    " I saw it as wanting a list of the folders and their nested folders/files" - The OP wants a list of the folders within the pst file - "Create a tree-type list of folders contained in a 45+ GB PST"

    Yes, the VBA script does what the OP wants - it lists the folders [and optionally the Outlook items such as emails] within the pst file.

    Denis
      My Computer


  6. Posts : 56,826
    Multi-boot Windows 10/11 - RTM, RP, Beta, and Insider
       #16

    Try3 said:
    " I saw it as wanting a list of the folders and their nested folders/files" - The OP wants a list of the folders within the pst file - "Create a tree-type list of folders contained in a 45+ GB PST"

    Yes, the VBA script does what the OP wants - it lists the folders [and optionally the Outlook items such as emails] within the pst file.

    Denis
    Now I understand. The .pst "file" and it's "folders" are not an NTFS tree structure visible to Explorer as such. PST is a proprietary MS format that stores "Folders" in a cache inside the .pst. So another method is needed, such as your script. It was the repetitive use of "folders and files" that threw me. Not that familiar with Office proprietary file formats.
      My Computers


  7. Posts : 16,948
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #17

    f14tomcat,

    Correct, an Outlook file [pst {local}, ost {IMAP, EAS}] contains folders similar to those you find in online email services such as Outlook.com & GMail. They are called folders because they are displayed just like folders are in File explorer. Within a folder, there can be Outlook items such as emails, calendar appointments, … ; these might often be referred to as "files" but they are really just items within the .pst file.

    In the case of Outlook there are a lot of folders because of its extensive capabilities. Even a brand new pst file has these folders: Calendar, Contacts, Inbox, Drafts, Outbox, Sent items, Junk email, Notes [post-its}, Tasks, Deleted items [and can already have an RSS Feeds folder as well].
    - Then you tend to add folders for particular purposes such as additional email folders for ProjectX, ProjectY, ProjectZ.
    - Then you add several folders within the ProjectX folder so you can separate emails about why it is so late from those about why it is so far over budget.
    - These folders can end up numbering hundreds and it is possible to lose track of what you put where if you use Outlook for several years. That is the OP's current dilemma.
    - In addition, each Outlook folder might well be matched by a folder somewhere within File explorer because every project will also be generating documents, spreadsheets, … so there are even more places to search for any particular piece of information.
    - Personally, I always reduce the complexity by limiting Outlook items, such as emails, to work in hand. Anything for which action is complete for the time being gets dragged across out of Outlook and into a relevant File explorer folder. That means that I need far fewer folders within Outlook's pst file and those that I do need are for work in hand so I am likely to remember what everything is.
    - An Outlook item [such as an email] becomes an .msg file when dragged into the main filing system. It can be opened again by Outlook and its contents are searchable by standard Windows searching. So everything to do with a given topic can be filed in one main filing system folder irrespective of which application created it.

    Denis
      My Computer


  8. Posts : 232
    Win 10 Ver 1903
    Thread Starter
       #18

    Denis:
    you have been correct on all counts
    There has a been much happening with this and i have not had time to test the final script
    My Bad. But! I WILL need it or something like it very soon/ Finding the Cause for the problem had become more important than proving its existence..
      My Computer


  9. Posts : 16,948
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #19

    I have seen your 2 PMs. In reverse order,

    PM2 - This is a VBA script. You paste it into the VBA Editor in Outlook.

    PM2 -
    questorfla - Sun, 19 May 2019 16:33:45 -0600 said:
    Does this or CAN this Script be set to display the Sizes of the Folders
    No, it cannot do this as it is written. There is no size property available using that method. It would be possible using a different approach but although I have found some sample code I cannot bring the two different approaches together properly.

    The sample is at vba - Determine the size of the emails in an outlook folder? - Stack Overflow
    - This sample will get you the folder sizes
    - Folder sizes are for each folder only - the size of subfolders is not included
    - I suggest replacing the line
    Debug.Print folder.Name & " - " & size
    with
    Debug.Print folder.FolderPath & " - " & size
    - The output appears in the Immediate window in the VBA editor [which is shown by default]. Afterwards, click in the Immediate window then select all the results [Ctrl A] then copy & paste them into a text file or Excel to process them.
    - If you paste both this output and the output of my script into Excel I think you should be able to marry them together.

    Notes
    - I do not understand why size is useful for reviewing the pst contents when the count of items can serve as a decent priority indicator
    - A pst file holds more than just folders. It also has a lot of other Outlook functionality tucked away within it {such as its message handling Rules}. So a pst file will always be larger than the sum of its folder sizes.
    - I do not understand why you have deleted Sent items. I would expect there to be lots of useful items in there.

    Denis
      My Computer


  10. Posts : 16,948
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #20

    Amended & now corrected sample script from StackOverflow


    This is the sample script I referred to above. I have done the single alteration I suggested.

    This post originally had a copying error in it. Three lines were concatenated into one. I have now corrected that.

    Taken from vba - Determine the size of the emails in an outlook folder? - Stack Overflow

    Code:
    Public Sub PrintFolderSizes()
    
    Dim ns As NameSpace
    Dim folder As MAPIFolder
    
    Set ns = GetNamespace("MAPI")
    
    For Each folder In ns.Folders
        ProcessFolder folder
    Next
    
    End Sub
    
    Private Sub ProcessFolder(folder As MAPIFolder)
    
    Dim folder2 As MAPIFolder
    Dim obj As Object
    Dim size As Double
    
    If Not folder.Items Is Nothing Then
        For Each obj In folder.Items
            size = size + obj.size
        Next
    End If
    
    Debug.Print folder.FolderPath & " - " & size
    
    For Each folder2 In folder.Folders    
        ProcessFolder folder2
    Next
    
    End Sub
    Last edited by Try3; 23 May 2019 at 16:30.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 05:37.
Find Us




Windows 10 Forums