Events no longer firing

G

Guest

Hi,

I am a newbie; I wrote the following code as VBA in Outlook:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If (Not Item.Class = olMail) Then Exit Sub

If (Item.Subject = "") Then
answer = MsgBox("Do you want to send the message without entering
a subject", vbYesNo, vbSystemModal)
If (answer = vbNo) Then
Cancel = True
End If
End If
End Sub


The code worked fine "till" I restarted outlook. It's weird that it's no
longer working. Can anyone give me some ideas? I am not using Exchange
Server. The code had been written for "ThisOutlookSession." Any help will
be highly appreciated.

/jaywalker
 
M

Muhammad Ali Shah

OK; I got it. VBA isn't loading. Setting the Macro security to Medium
prompted me whether I want to run macros or not. If I say Yes,
everything works fine.
 

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