I would like to have a vba script that prompts the user when they press send. I need Yes, No, and Cancel.
When the user answers yes it would insert a comment into the subject line and send the email.
When the user answers no it would send the email like yes would without the comment. ( Currently the code below, the function of yes is what I want the function of no to do.)
I figured out how to make cancel do exactly what I want.
This example I found with some tweaking does partially what I need.
I've been searching and playing with the code all day, any help would be amazing!
When the user answers yes it would insert a comment into the subject line and send the email.
Code:
Set olkMsg = Outlook.Application.ActiveInspector.CurrentItem
olkMsg.Subject = "[Sending Secure]"
When the user answers no it would send the email like yes would without the comment. ( Currently the code below, the function of yes is what I want the function of no to do.)
I figured out how to make cancel do exactly what I want.
This example I found with some tweaking does partially what I need.
Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim MsgQuery As String
If TypeOf Item Is Outlook.MailItem Then
MsgQuery = "You are sending this email to :" & vbCr & vbCr
If Item.Recipients.Count > 0 Then
For i = 1 To Item.Recipients.Count
MsgQuery = MsgQuery & vbTab & Item.Recipients(i) & vbCr
Next
End If
MsgQuery = MsgQuery & vbCr & "Are you sure you want to send this email?"
If MsgBox(MsgQuery, vbYesNoCancel + vbQuestion + vbMsgBoxSetForeground, Item.Subject) = vbCancel Then
Cancel = True
End If
End If
End Sub
I've been searching and playing with the code all day, any help would be amazing!