ไปยังเนื้อหาหลัก

จะตอบกลับอัตโนมัติด้วยข้อความอีเมลต้นฉบับใน Outlook ได้อย่างไร

โดยปกติเมื่อเราสร้างกฎอัตโนมัติให้ใช้อีเมลไม่อยู่ที่สำนักงาน แต่ข้อความต้นฉบับในเนื้อหาจะไม่รวมอยู่ด้วย คุณจะพึ่งพาอีเมลที่มีข้อความต้นฉบับใน Outlook โดยอัตโนมัติได้อย่างไร บทความนี้ฉันจะพูดถึงรหัส VBA เพื่อช่วยให้คุณทำงานนี้ให้เสร็จโดยเร็วที่สุดใน Outlook

ตอบกลับอีเมลอัตโนมัติพร้อมข้อความต้นฉบับใน Outlook พร้อมรหัส VBA


ตอบกลับอีเมลอัตโนมัติพร้อมข้อความต้นฉบับใน Outlook พร้อมรหัส VBA

กฎ Outlook ปกติไม่สามารถช่วยคุณจัดการกับงานได้ แต่ด้วยรหัส VBA ต่อไปนี้คุณสามารถดำเนินการนี้ให้เสร็จได้อย่างรวดเร็วและง่ายดาย กรุณาทำตามนี้:

1. กด ALT + F11 คีย์เพื่อเปิด Microsoft Visual Basic สำหรับแอปพลิเคชัน หน้าต่าง

2. ใน Microsoft Visual Basic สำหรับแอปพลิเคชัน ดับเบิลคลิก นี้OutlookSession จาก โครงการ 1 (VbaProject.O ™) บานหน้าต่างเพื่อเปิดโหมดจากนั้นคัดลอกและวางรหัสต่อไปนี้ลงในโมดูลเปล่า

รหัส VBA: ตอบกลับอีเมลอัตโนมัติพร้อมข้อความต้นฉบับ:

Public WithEvents xlItems As Outlook.Items
Private Sub Application_Startup()
    Set xlItems = Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub xlItems_ItemAdd(ByVal objItem As Object)
Dim xlReply As MailItem
Dim xStr As String
If objItem.Class <> olMail Then Exit Sub
Set xlReply = objItem.Reply
With xlReply
     xStr = "<p>" & "Hi, Your email has been received. Thank you!" & "</p>"
     .HTMLBody = xStr & .HTMLBody
     .Send
End With
End Sub 

3. จากนั้นบันทึกและปิดหน้าต่างรหัสปิดหรือรีสตาร์ท Outlook เพื่อให้รหัส VBA มีผล ตอนนี้เมื่อคุณได้รับอีเมล Outlook จะส่งการตอบกลับอัตโนมัติพร้อมข้อความต้นฉบับดังภาพหน้าจอต่อไปนี้:


สุดยอดเครื่องมือเพิ่มผลผลิตในสำนักงาน

Kutools สำหรับ Outlook - คุณสมบัติอันทรงพลังมากกว่า 100 รายการเพื่อเติมพลังให้กับ Outlook ของคุณ

🤖 ผู้ช่วยจดหมาย AI: ส่งอีเมลระดับมืออาชีพทันทีด้วยเวทมนตร์ AI คลิกเพียงครั้งเดียวเพื่อตอบกลับอย่างชาญฉลาด น้ำเสียงที่สมบูรณ์แบบ การเรียนรู้หลายภาษา เปลี่ยนรูปแบบการส่งอีเมลอย่างง่ายดาย! ...

📧 การทำงานอัตโนมัติของอีเมล: ไม่อยู่ที่สำนักงาน (ใช้ได้กับ POP และ IMAP)  /  กำหนดการส่งอีเมล  /  Auto CC/BCC ตามกฎเมื่อส่งอีเมล  /  ส่งต่ออัตโนมัติ (กฎขั้นสูง)   /  เพิ่มคำทักทายอัตโนมัติ   /  แบ่งอีเมลผู้รับหลายรายออกเป็นข้อความส่วนตัวโดยอัตโนมัติ ...

📨 การจัดการอีเมล์: เรียกคืนอีเมลได้อย่างง่ายดาย  /  บล็อกอีเมลหลอกลวงตามหัวเรื่องและอื่นๆ  /  ลบอีเมลที่ซ้ำกัน  /  การค้นหาขั้นสูง  /  รวมโฟลเดอร์ ...

📁 ไฟล์แนบโปรบันทึกแบทช์  /  การแยกแบทช์  /  การบีบอัดแบบแบตช์  /  บันทึกอัตโนมัติ   /  ถอดอัตโนมัติ  /  บีบอัดอัตโนมัติ ...

🌟 อินเตอร์เฟซเมจิก: 😊อีโมจิที่สวยและเจ๋งยิ่งขึ้น   /  เพิ่มประสิทธิภาพการทำงาน Outlook ของคุณด้วยมุมมองแบบแท็บ  /  ลดขนาด Outlook แทนที่จะปิด ...

???? เพียงคลิกเดียวสิ่งมหัศจรรย์: ตอบกลับทั้งหมดด้วยไฟล์แนบที่เข้ามา  /   อีเมลต่อต้านฟิชชิ่ง  /  🕘 แสดงโซนเวลาของผู้ส่ง ...

👩🏼‍🤝‍👩🏻 รายชื่อและปฏิทิน: แบทช์เพิ่มผู้ติดต่อจากอีเมลที่เลือก  /  แบ่งกลุ่มผู้ติดต่อเป็นกลุ่มแต่ละกลุ่ม  /  ลบการแจ้งเตือนวันเกิด ...

เกิน คุณสมบัติ 100 รอการสำรวจของคุณ! คลิกที่นี่เพื่อค้นพบเพิ่มเติม

 

 

Comments (8)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello

I have another question. How can I change the Session.GetDefaultFolder(olFolderInbox).Items. I work with several email accounts and I need this response just from 3 of them.

Thank you in advance
This comment was minimized by the moderator on the site
Hi,
I have another question:
How do I apply this rule to a specific selected sender only
Session.GetDefaultFolder(olFolderInbox).Items
This comment was minimized by the moderator on the site
HiI have the same question : how do I apply this rule to selected sender only ?br
This comment was minimized by the moderator on the site
Hello, Damien,For specifying some senders when auto reply, please apply the below code:

<div data-tag="code">Public WithEvents xlItems As Outlook.Items
Private Sub Application_Startup()
Set xlItems = Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub xlItems_ItemAdd(ByVal objItem As Object)
Dim xlReply As MailItem
Dim xStr As String
Dim xSenderAddr As String
On Error Resume Next
If objItem.Class <> olMail Then Exit Sub
xSenderAddr = "," 'type your own sender emials here, separate them by commas.
If objItem.Sender.Type = "EX" Then
If InStr(xSenderAddr, objItem.Sender.GetExchangeUser.PrimarySmtpAddress) = 0 Then Exit Sub
Else
If InStr(xSenderAddr, objItem.Sender.Address) = 0 Then Exit Sub
End If
Set xlReply = objItem.Reply
With xlReply
xStr = "<p>" & "Hi, Your email has been received. Thank you!" & "</p>"
.HTMLBody = xStr & .HTMLBody
.Send
End With
End SubPlease try, hope it can help you!
This comment was minimized by the moderator on the site
Hi , I've try this , but wouldn't work (:
This comment was minimized by the moderator on the site
How can you modify this to only run if there is a keyword in the message of the body?
This comment was minimized by the moderator on the site
I have the same question, did you figure it out?
This comment was minimized by the moderator on the site
try thisDim olMail As object
If (olMail.Subject Like "*Place_Keyword_here(Leave_doublequotes_and_asteriscs)*") Then
CodeEnd if
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations