H
hogwell
Help!
I am trying to write a custom action for a client-side rule in Outlook
2007.
When an incoming email arrives with certain text in the subject, I
want to send a canned Reply email to the SenderName given by the
incoming email, which will be a valid email address.
This code works, and it pops up a msgbox with the SenderName shown
(note the commented-out code):
Sub CustomMailMessageRule(MyMail As Outlook.MailItem)
On Error GoTo AnError
MsgBox "Mail message arrived from: " & MyMail.SenderName
'Dim objReplyMail As Outlook.MailItem
'Set objReplyMail = Application.CreateItem(olMailItem)
'objReplyMail.Recipients.Add "(e-mail address removed)"
'MyMail.SenderName
'objReplyMail.SenderEmailAddress = "(e-mail address removed)"
'objReplyMail.Body = "test: " & MyMail.SenderName
'objReplyMail.Send
'Set objReplyMail = Nothing
Exit Sub
AnError:
MsgBox Err.Description
End Sub
However, if I uncomment the code so that an email will be generated,
the action does *nothing*, not even pops up an error msgbox !!!
What am I doing wrong here?
Is there some security setting that might be silently disabling the
script when I uncomment the code?
Thanks for any advice!
I am trying to write a custom action for a client-side rule in Outlook
2007.
When an incoming email arrives with certain text in the subject, I
want to send a canned Reply email to the SenderName given by the
incoming email, which will be a valid email address.
This code works, and it pops up a msgbox with the SenderName shown
(note the commented-out code):
Sub CustomMailMessageRule(MyMail As Outlook.MailItem)
On Error GoTo AnError
MsgBox "Mail message arrived from: " & MyMail.SenderName
'Dim objReplyMail As Outlook.MailItem
'Set objReplyMail = Application.CreateItem(olMailItem)
'objReplyMail.Recipients.Add "(e-mail address removed)"
'MyMail.SenderName
'objReplyMail.SenderEmailAddress = "(e-mail address removed)"
'objReplyMail.Body = "test: " & MyMail.SenderName
'objReplyMail.Send
'Set objReplyMail = Nothing
Exit Sub
AnError:
MsgBox Err.Description
End Sub
However, if I uncomment the code so that an email will be generated,
the action does *nothing*, not even pops up an error msgbox !!!
What am I doing wrong here?
Is there some security setting that might be silently disabling the
script when I uncomment the code?
Thanks for any advice!