"Is there any way I can set up a warning (or possibly limit) on the size of file I can email? I'm guilty of accidentally sending 13mb files."
Sure, you can use VBA to warn you.
A very basic warning uses this simple code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) If Item.Attachments.Count > 0 Then ans = MsgBox("Is the attachment too big?", vbYesNo) If ans = vbYes Then Cancel = True End If End Sub
This simple procedure checks for the presence of attachments and asks if the attachments are too large. While this is fine if you don't send a lot of attachments, it would be even better if you were alerted only when the message size was too large.
Better VBA
Outlook MVP Michael Bauer offers this procedure that checks for the presence of attachments and if any are found, it checks the message size. When the message exceeds the Max_item_size you configured, a warning dialog pops up.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) If TypeOf Item Is Outlook.MailItem Then Cancel = Not (ConfirmBigAttachments(Item)) End If End Sub Private Function ConfirmBigAttachments(oMail As Outlook.MailItem) As Boolean ' by Michael Bauer //www.vboffice.net Dim lSize As Long Const MAX_ITEM_SIZE As Long = 1048576 ' in Bytes. This is 1 MB 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) End If End If ConfirmBigAttachments = bSend End Function
How to Use
To use either of these code samples with Outlook, open the VBA editor (Alt+F11) then copy and paste the code into ThisOutlookSession. The max_item_size is set for 1 megabyte but can be changed to any number. Save it and every time you send a message, the ItemSend procedure will run.
If you need help converting megabytes to bytes, go to google and type "x megabyte in bytes" into the search field, where x is the number you need to convert.
Not sure if it is due to Outlook versions, but Item.Size stays 0 for me all the time (Outlook 2019), if I add up all Item.Attachments(x).Size instead it works fine.
Thanks!
Outlook.mailitem, doesn't work in outlook 2013
This made it work instead: https://social.technet.microsoft.com/Forums/office/en-US/1e1b0724-3b9e-4149-ae5b-d01c43b51f42/attachment-warning-custom-vba-for-outlook-2010
It does, it works in all versions of Outlook. It won't work for meeting requests etc, but will work with actual email.
Although this is an old post, my two cents:
This doesn't work for a different reason - the MailItem.Size is 0 unless the mail item is saved beforehand.
You have either to save the mail before checking the size, or ignore the text itself and its size and loop the attachments and add their sizes into the lSize. I am using the second method, because just the check for the attachments size is precise enough for me.