How to run my Mcros that i have created in VB editor?

  • Thread starter Thread starter Chenna Krishna
  • Start date Start date
C

Chenna Krishna

Hi,

I have used the follwing code in the VB editor.

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim strSubject As String
strSubject = Item.Subject
If Len(Trim(strSubject)) = 0 Then
Prompt$ = "Subject is Empty. Are you sure you want to send the Mail?"
If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for
Subject") = vbNo Then
Cancel = True
End If
End If
End Sub

The above code should not send any message from my outlook which has empty
subject. The problem that i face is it has worked successfuly when i have
done first time but now its not executing.
Please help me in this regard.
Thanks in advance,

Regards,
Chenna Krishna
 
Is it in the ThisOutlookSession class module?

Are macros enabled for running in Tools, Macro, Security?
 
Yes it is in the hisOutlookSession only.
I have reduced the macro security level to low also and executed but no
results.
 
Did you restart Outlook after changing the setting? Outlook reads that
setting on startup.
 
Yes i have closed the outlook and started again. Do i need to restart my
system also because i wil be restarting my system only for 15-20 days once.
 
Back
Top