Item count in a PST file.

We need to be able to get a Count of ALL items in a PST file, size is irreverent.

VB Scripts are out of the question.

Is there any way to just get a tally of total items in a single PST file?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris BottomleySoftware Quality Lead EngineerCommented:
I believe the answer is you cannot without a script of some kind.

Note a script can be VBA within Outlook itself or even a stand alone script that does the job.  Assuming you are not allowed to add macros to outlook the use of a stand alone script may therefore meet your needs.

An example of a stand alone script is as follows ... save as something.vbs and then execute it by double clicking .. modify the relevant PST name on line 4 as appropriate.

    Set olkApp = CreateObject("outlook.application")
    Set fldr = olkApp.session.folders("Personal Folders")
    funItemCount fldr, itemcount, foldercount
    MsgBox "Count of Items :> " & itemcount & vbCrLf & "Count of Folders :> " &foldercount

Function funItemCount(fldr, itemcount, foldercount)
    itemcount = itemcount + fldr.Items.Count
    foldercount = foldercount + 1
    For Each subFolder In fldr.Folders
        funItemCount subFolder, itemcount, foldercount

End Function

Open in new window

yo_beeDirector of Information TechnologyCommented:
If vbs is out what method are you looking to use to accomplish this task?
BBDallasAuthor Commented:
I was hoping there was a PS command from part of Exchange PS aplets.  Or a way to use an exchange PS aplet to get to the same function without having to import the pst into exchange.

Or shot just a way in outlook to get counts, but it appears outlook only does a raw count for an exchange mailbox.
Chris BottomleySoftware Quality Lead EngineerCommented:
You can use the VBA to get the count for any folder ... you just need to specify the folder and then depending on yout outlook version will depend on just how flexible we can be ... but it is certainly doable as an outlook or stand alone script as shown above.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.