StartDownloadsServiceSamplesWorkshopsContact DeutschEnglish
 
Samples
General
Outlook®
 
Awarded by
Microsoft since 2005:
mvp logo
VBOffice Info
Visitors1771060
Impressions6642122
Links
Imprint
Privacy Policy
Contact
E-Mail: Check item size before sending
Author: Michael BauerHomepage
Date: 18.01.2006Accessed: 26209
  
Description

This sample checks an e-mail's size before sending. You can cancel if it exceeds a pre-determined size.

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
  Dim lSize As Long
  Const MAX_ITEM_SIZE As Long = 10000 ' Byte
  Dim bSend As Boolean

  bSend = True
  If oMail.Attachments.Count Then
    oMail.Save
    lSize = oMail.Size
    If lSize > MAX_ITEM_SIZE Then
'      bSend = (MsgBox("Größe: " & lSize & " Byte. Abbrechen?", vbYesNo) = vbNo)
      bSend = (MsgBox("Item's size: " & lSize & " Byte. Cancel?", vbYesNo) = vbNo)
    End If
  End If
  ConfirmBigAttachments = bSend
End Function
 
 

ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the ... [more]

 

Access the master category list in the blink of an eye, share your categories in a network, get a reminder service, and ... [more]

 

SAM automatically sets the sender, signature, and folder for sent items, for instance based on the recipient ... [more]

 

OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or ... [more]