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

Page 2 of 3 FirstFirst 123 LastLast
  1. Try3's Avatar
    Posts : 1,787
    Windows 10 Home x64 and Pro x86
       #11

    Samuria said: View Post
    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 ComputerSystem Spec

  2. f14tomcat's Avatar
    Posts : 41,586
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       #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.

    Click image for larger version. 

Name:	2019-05-17_20h38_37.png 
Views:	34 
Size:	101.9 KB 
ID:	234105TreeSize Free Export.pdf

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

  3. Try3's Avatar
    Posts : 1,787
    Windows 10 Home x64 and Pro x86
       #13

    f14tomcat said: View Post
    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 ComputerSystem Spec

  4. f14tomcat's Avatar
    Posts : 41,586
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       #14

    Try3 said: View Post
    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 ComputersSystem Spec

  5. Try3's Avatar
    Posts : 1,787
    Windows 10 Home x64 and Pro x86
       #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 ComputerSystem Spec

  6. f14tomcat's Avatar
    Posts : 41,586
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       #16

    Try3 said: View Post
    " 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 ComputersSystem Spec


  7. Try3's Avatar
    Posts : 1,787
    Windows 10 Home x64 and Pro x86
       #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 ComputerSystem Spec

  8.    #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 ComputerSystem Spec

  9. Try3's Avatar
    Posts : 1,787
    Windows 10 Home x64 and Pro x86
       #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 ComputerSystem Spec

  10. Try3's Avatar
    Posts : 1,787
    Windows 10 Home x64 and Pro x86
       #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; 3 Weeks Ago at 16:30.
      My ComputerSystem Spec


 
Page 2 of 3 FirstFirst 123 LastLast

Related Threads
HI, I have a folder containing 9,987 .jpg's of which I need to copy about 500 of to a different folder. I have the file names in a .txt file on separate lines as well as in a .csv worksheet. I don't want to find them individually to select/copy...
Hi. Below link shows a method to do that, but its probably for older versions of windows. How to Copy a List of Files in a Windows Folder Into an Excel List | Chron.com In windows 10, when I Shift+right click on a folder to open the Powershell...
I generally use a lot of sub folders when working with files, so normally have a file window open with a log of open file branches. It makes it easier to work among different file types, etc. After the update to Windows 10 I've noticed an...
It works fine, but suddenly today the New menu disappeared from my click menu when I click on any blank place in a folder. What's worse, if I click the New Folder button under the File Explorer top menu, there is no response. In the end, I can only...
Hi everyone, It seem my windows 10 Home having problem, a simple malfunction which I don't understand why this happening, the problem related to each time I create a new folder or copy a file to a specific folder it doesn't appear until press...
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 06:39.
Find Us