I've got an outlook script which shows you the recipient and prompts the user "Are you sure you wish to send this e-mail to XXX?" However, we have an issue with a plugin we use to send secure files which prompts the user twice from the script instead of once. They tell me to loop through the items.Attachments property to check for a filename ending with ".sf". If it contains this then to abort my script. Can anyone tell me how to do this?
Private Sub Application_ItemSend _ (ByVal Item As Object, Cancel As Boolean)
Dim strMsg As String
Dim Atmt As Variant
If Item.Class = "43" Then
For Each Atmt In Item.Attachments
If Right(Atmt.FileName, 3) = ".sf" Then
GoTo NonEmailError
End If
Next Atmt
If Item.CC = "" Then
strMsg = "To recipients: " & Item.To & vbCrLf & _
"Are you sure you want to send this message?"
Else
strMsg = "To recipients: " & Item.To & vbCrLf & _
"Cc recipients: " & Item.CC & vbCrLf & _
"Bcc recipients: " & Item.BCC & vbCrLf & _
"Are you sure you want to send this message?"
End If
Else
GoTo NonEmailError
End If
On Error GoTo NonEmailError
NonEmailError:
' The item being sent was not an e-mail and so don't prompt the user anything
Exit Sub
End Sub