简体   繁体   中英

Outlook to automatically reply all based on the body

well, I do receive lots of emails to release shipments. I want to creat VBA to reply all based on a statement in the email body. Any help?

The first thing from which you can start is to handle the NewMailEx event of the Application class which is fired when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the EntryIDCollection array to call the NameSpace.GetItemFromID method and process the item.

This event fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example, MailItem , MeetingItem , or SharingItem . The EntryIDsCollection string contains the Entry ID that corresponds to that item.

As soon as you have got an item you may check the message body represented by the HTMLBody or just Body which returns a plain text string that represents the message body.

The ReplyAll method creates a reply to all original recipients from the original message. A MailItem object that represents the reply is returned. Finally, use the Send method to submit the reply for processing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM