New
#11
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.
TreeSize Free Export.pdf
TreeSize Free - Quickly Scan Directory Sizes and Find Space Hogs
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.
" 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.
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
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..
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 -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.questorfla - Sun, 19 May 2019 16:33:45 -0600 said:
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
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.