B
Ben Rodden
Hello,
I am trying to write a vba macro in Outlook that will
stop a message from being sent if the user has not
entered a subject. Here is the code that I have so far:
Private Sub application_itemsend(ByVal item As Object,
cancel As Boolean)
If item.Subject = "" Then
cancel = True
Dim iMsgBoxSel
iMsgBoxSel = MsgBox("Please fill in the subject
before sending.", vbSystemModal, "Missing Subject")
If iMsgBoxSel = vbOK Then
End If
End If
End Sub
This code works perfectly, except that the main Outlook
window becomes active after the macro is done running. I
want the active window to be the new message.
Any suggestions would be greatly appreciated!
Thanks!
I am trying to write a vba macro in Outlook that will
stop a message from being sent if the user has not
entered a subject. Here is the code that I have so far:
Private Sub application_itemsend(ByVal item As Object,
cancel As Boolean)
If item.Subject = "" Then
cancel = True
Dim iMsgBoxSel
iMsgBoxSel = MsgBox("Please fill in the subject
before sending.", vbSystemModal, "Missing Subject")
If iMsgBoxSel = vbOK Then
End If
End If
End Sub
This code works perfectly, except that the main Outlook
window becomes active after the macro is done running. I
want the active window to be the new message.
Any suggestions would be greatly appreciated!
Thanks!