tailieunhanh - Office VBA Macros You Can Use Today phần 8

Với thủ tục này, bạn có thể gửi một tin nhắn được xác định trước như là một trả lời thư điện tử được lựa chọn. Lưu ý: Thủ tục này cung cấp mã sử dụng các đối tượng Redemption, yêu cầu cài đặt của các đối tượng COM Redemption. | Outlook Procedures Auto Replying to Selected E-mail Messages With this procedure you can send a predefined message as a reply to selected email messages. Note This procedure provides code using the Redemption object which requires installation of the Redemption COM Object. View the Appendix to learn how to store this procedure in a Standard module. Option explicitfl Public Sub SendAutoReply fl Outlook Application Objects declarationfl Dim objExp As Dim objMail As Dim objItem As Objectfl Redemption SafeMail object declarationfl Dim objSafeMail As Objectfl Auto Reply message variablefl Dim strReplyMessage As Stringfl Set this variable as desiredfl strReplyMessage Thank you Your order will be _fl processed immediately fl Set active explorer objectfl Set objExp Loop in selected items in Active Explorerfl For Each objItem In If selected item is a mail item then executefl auto reply functionfl If olMail Thenfl Set mail item object as the selected itemfl Set objMail objItemfl Create a reply mail object by using selected mail objectfl Set objMail Redemption Addition starts herefl Create Redemption SafeMail objectfl Use this object to send message withoutfl security warningfl Set objSafeMail CreateObject fl Set objMailfl Redemption Addition stops herefl Add requested auto message to current message as replyfl With objSafeMail Using Redemption Safe Mail Item objectfl .HTMLBody strReplyMessage vbCrLf .HTMLBodyfl For Plain Text reply use the followingfl Out Office VBA Macros You Can Use Today page 301 Outlook Procedures Out Body property setting instead HTMLBodyfl Please comment out the previous code linefl .Body strReplyMessage vbCrLf .Bodyfl Send reply immediatelyfl .Sendfl End Withfl End Iffl Continue with next selected item in active explorerfl Next objItemfl End Subfl To send the same reply to specific e-mail messages

TỪ KHÓA LIÊN QUAN