|VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.
This sample checks an e-mail's size before sending. You can cancel if it exceeds a pre-determined size. Here the limit is set to 10,000 bytes, which is a little less than 10kb. Adjust the value if needed.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If TypeOf Item Is Outlook.MailItem Then
Cancel = Not (ConfirmBigAttachments(Item))
Private Function ConfirmBigAttachments(oMail As Outlook.MailItem) As Boolean
Dim lSize As Long
Const MAX_ITEM_SIZE As Long = 10000 ' Byte
Dim bSend As Boolean
bSend = True
If oMail.Attachments.Count Then
lSize = oMail.Size
If lSize > MAX_ITEM_SIZE Then
bSend = (MsgBox("Item's size: " & lSize & " Byte. Cancel?", vbYesNo) = vbNo)
ConfirmBigAttachments = bSend