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

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
 
K

Ken Slovak - [MVP - Outlook]

Is it in the ThisOutlookSession class module?

Are macros enabled for running in Tools, Macro, Security?
 
C

Chenna Krishna

Yes it is in the hisOutlookSession only.
I have reduced the macro security level to low also and executed but no
results.
 
K

Ken Slovak - [MVP - Outlook]

Did you restart Outlook after changing the setting? Outlook reads that
setting on startup.
 
C

Chenna Krishna

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.
 

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