Originally Posted by
skatonni
Try this.
[vba]
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim strSubject As String
Dim lngAttach As Long
Dim strPrompt As String
strSubject = Item.Subject
lngAttach = Item.Attachments.count
If lngAttach = 0 Then
strPrompt = "are there no attachment to this mail - Yes we have no attachments today"
If MsgBox(strPrompt, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Attachment") = vbNo Then
Cancel = True
End If
End If
If Len(Trim(strSubject)) = 0 Then
strPrompt = "Subject is Empty. Are you sure you want to send the Mail?"
If MsgBox(strPrompt, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo Then
Cancel = True
End If
End If
End Sub
[/vba]