View Single Post
 
Old 02-04-2016, 06:54 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,106
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

I would do things differently. As I understand it from your code, you want to send a copy of each message you send to another e-mail address but with any attachments removed? That being the case
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim olCopy As MailItem
Dim olAtt As Attachment
    Set olCopy = Item.Forward
    With olCopy
        For Each olAtt In olCopy.Attachments
            olAtt.Delete
        Next olAtt
        .To = "someone@gmail.com"
        .Send
    End With
lbl_Exit:
    Exit Sub
End Sub
should work.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote