我正在尝试触发带有规则的脚本以发送自动回复。
“您好,感谢您的来信,您的邮件已排入队列,您面前有XX封邮件,我们会尽快回复。”
XX 应该是未读电子邮件的数量。
Private Sub myOlItems_ItemAdd(ByVal Item As Object)
End Sub
Sub AutoResponse(objmsg As Outlook.MailItem)
' define my reply message
Dim objReply As MailItem
' let's get ourselves the inbox!
Dim inbox As MAPIFolder
Set inbox = Application.GetNamespace("MAPI"). _
GetDefaultFolder(olFolderInbox)
' Let's get this reply going!
Set objReply = objmsg.Reply
' Subject Re: their subject. Standard
objReply.Subject = "Re: " & objReply.Subject
' Body - you define this, use the variable for the unread count in inbox
objReply.Body = "Your email has been received. I currently have " & inbox.UnReadItemCount & " unread emails in my inbox and I will get yours as soon as I can"
' Send this thing!
objReply.Send
' Reset
Set objReply = Nothing
End Sub
它不起作用。
我在 Outlook 2016 上,使用交换邮件服务器。