Blank Subject Warning...

B

brodden

I have been trying to write a vba macro in Outlook that will give th
user a warning and not allow them to send a message if they don't pu
in a subject. Here is the code that I have so far:

Private Sub application_itemsend(ByVal item As Object, cancel A
Boolean)

If item.Subject = "" Then

cancel = True

Dim iMsgBoxSel

iMsgBoxSel = MsgBox("Please fill in the subject befor
sending.", vbSystemModal, "Missing Subject")

If iMsgBoxSel = vbOK Then



End If

End If

End Sub

Everything works perfectly, except that when the macro is done, th
main Outlook window becomes active and I can't figure out how to mak
the new message active again after the user hits OK.

Any suggestions would be greatly appreciated.

Thanks
 

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