Outlook 2007 - get size of selected items

Is there a way to get the total size of selected e-mails or items?

The folder size breaks down each of the folders and subfolders, but what if I want to select only a bunch of different e-mails and get the size of them combined?

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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.

No there is no way to deternine the size of selected emails. This is by design .
David LeeCommented:
Hi, garryshape.

It's simple to get the size of the selected items using a bit of scripting.  Follow these instructions to add the code to Outlook.

1.  Start Outlook
2.  Click Tools > Macro > Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects
4.  If not already expanded, expand Modules
5.  Select an existing module (e.g. Module1) by double-clicking on it or create a new module by right-clicking Modules and selecting Insert > Module.
6.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
7.  Edit the code as needed.  I included comments wherever something needs to or can change
8.  Click the diskette icon on the toolbar to save the changes
9.  Close the VB Editor

To use the code

1.  Select one or more items
2.  Run the macro

You can make running the macro simpler by creating a toolbar button.  Here's how to do that.

1.  Click View > Toolbars > Customize
2.  Click the Toolbars tab
3.  Click New
4.  Name the toolbar
5.  Click the Commands tab
6.  Under Categories click Macros
7.  Under Commands click and hold on the macro, then drag it out and drop it on the new toolbar
8.  Dock the toolbar somewhere onscreen

Sub GetSize()
    Dim olkItem As Object, lngSize As Long
    For Each olkItem In Application.ActiveExplorer.Selection
        lngSize = lngSize + olkItem.Size
    msgbox "The size of the selected items is " & Format(lngSize, "###,###,##0") & " bytes.", vbInformation + vbOKOnly, "Get Size"
    Set olkItem = Nothing
End Sub

Open in new window

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
garryshapeAuthor Commented:
Awesome. Works like a charm.
Thanks very much.
David LeeCommented:
You're welcome.  Glad I could help.
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.