Windows Explored

Everyday Windows Desktop Support, Advanced Troubleshooting & Other OS Tidbits

User Request – Count Outlook Attachments in Outlook

Posted by William Diaz on August 3, 2010


Here is an odd user request presented to one of our techs. The user wanted to be able to count the number of attachments in an email, especially those with many attachments. You can do all kinds of stuff using Visual Basic in MS Office and a quick Internet search revealed some simple VB code that would create macro in Outlook to count attachments

To do this, open the Visual Basic Editor from Tools > Macro > Visual Basic Editor. Right-click the Modules folder and insert a new module and copy and paste the following text into the editor window:

Sub CountAttachmentsMulti()

Set mySelect = Outlook.ActiveExplorer.Selection
For Each Item In mySelect
j = Item.Attachments.Count + j
I = I + 1
Next Item
MsgBox “Selected ” & I & ” messages with ” & j & ” attachements”

End Sub

Add the macro to the Outlook standard toolbar or create a new one. Do the same for open messages. Now you can select a message, a range of messages, or open a message and run the macro and get a neat dialog box:

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: