Braveheart
Registered User.
- Local time
- Today, 20:00
- Joined
- Jun 11, 2014
- Messages
- 10
Could someone please help me with the below code. I know this is a access forum but im sure the VBA code for access will be similar and the knowledge of people on here will solve this no problem.
I have seen this code on another site and coded it into all the correct places on outlook but i cant get it to work when my signature image is there. The code is ment to deal with the signature but i just wont work. Can anyone help ? as this would be a savior for my business.
Here is the code
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If InStr(1, Item.Body, "attach", vbTextCompare) > 0 Then
If Item.Attachments.Count = 0 Then
answer = MsgBox("There's no attachment, send anyway?", vbYesNo)
If answer = vbNo Then Cancel = True
End If
If Item.Attachments.Count > 0 Then
For Each oAtt In Item.Attachments
Debug.Print oAtt.Size
If oAtt.Size < 5200 Then
GoTo NextAtt
Else
answer = MsgBox("There's no attachment, send anyway?", vbYesNo)
If answer = vbNo Then Cancel = True
End If
NextAtt:
Next oAtt
End If
End If
End Sub
This code is basically a failsafe to check for missing attachments before sending your email.
Thanks for any assistance
I have seen this code on another site and coded it into all the correct places on outlook but i cant get it to work when my signature image is there. The code is ment to deal with the signature but i just wont work. Can anyone help ? as this would be a savior for my business.
Here is the code
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If InStr(1, Item.Body, "attach", vbTextCompare) > 0 Then
If Item.Attachments.Count = 0 Then
answer = MsgBox("There's no attachment, send anyway?", vbYesNo)
If answer = vbNo Then Cancel = True
End If
If Item.Attachments.Count > 0 Then
For Each oAtt In Item.Attachments
Debug.Print oAtt.Size
If oAtt.Size < 5200 Then
GoTo NextAtt
Else
answer = MsgBox("There's no attachment, send anyway?", vbYesNo)
If answer = vbNo Then Cancel = True
End If
NextAtt:
Next oAtt
End If
End If
End Sub
This code is basically a failsafe to check for missing attachments before sending your email.
Thanks for any assistance
Last edited: