受信するすべての電子メールに返信するスクリプトを作成しています。
スクリプトを実行し、カテゴリを設定し、既読としてマークするすべての受信メッセージに対して実行するルールを作成しました。ルールはカテゴリを設定し、既読としてマークしますが、スクリプトは実行しません。以下は私のコードです:
Sub reply(Item As Outlook.MailItem)
MsgBox "Hey this script is running!"
On Error GoTo ErrorTrap
Dim MsgReply As Outlook.MailItem
Set MsgReply = Item.reply
With MsgReply
.Subject = "Welcome to IT Business Builder"
.HTMLBody = "This is just a test"
.Body = "This is just a test"
.Send
End With
Set MsgReply = Nothing
ErrorTrap:
MsgBox Err.Number & " " & Err.Description & " message not sent because of error"
End Sub
ルールを実行した後、メッセージ ボックスは表示されず、メールは送信されません。