My Outlook addin checks (when user click “send”) if a large attachment is attached. If so it should remove it and cancel the sending and give focus back to the user.
Here’s a sample of my Outlook addin code…
Private Sub ThisApplication_ItemSend(ByVal Item As Object, ByRef Cancel As Boolean) Handles Application.ItemSend
Dim mail As Outlook.MailItem = CType(Me.Application.ActiveInspector.CurrentItem, Outlook.MailItem)
For i As Integer = mail.Attachments.Count To 1 Step -1
mail.Attachments.Remove(i)
Next
Cancel = True
End Sub
The active mail item still shows all the attachements. 🙁
How do I get Outlook to remove all the attachments (before user sends the mail) and cancel the sending?
Thanks a million!
Mojo
Try this: