ThisOutlookSession macro problem


Joined
Jul 9, 2015
Messages
1
Reaction score
0
Hi People,

Long time lurker looking for some help. One of my users has a habit of bcc'ing herself and her pa's, not entering an address into the To field and wondering why the emails are not getting to the target then claims Outlook is stripping the To field on send (the user in question is the only person to report this issue).

I have the following macro in "ThisOutlookSession"

Private Sub Application_Itemsend(ByVal Item As Object, Cancel As Boolean)
Dim prompt As String
prompt = "The TO Field is empty, do you want to send?" & vbCrLf & _
"Click 'Yes' to send or 'No' to return to the message."
If Item.To = "" Then
If MsgBox(prompt, vbYesNo + vbQuestion, "TO Field is Empty") = vbNo Then
Cancel = True
End If
End If
End Sub

Basic trap and message/question combo.

Will only work if the VB Editor is opened and closed. If Outlook is restarted for any reason, then you have to open/close the VB editor again to make it function.

I've tried self certing the project with Notifications for digitally signed macros. Tried it with enabling all macros. Only thing that works it, is the open/close of the VB editor, dont even need to make any changes. Running out of hair to pull out, any help greatfully received,

Regards,

Robert.
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top