Direkt zum Inhalt

Wie antworte ich automatisch mit der ursprünglichen E-Mail-Nachricht in Outlook?

Wenn wir eine Regel erstellen, mit der die E-Mail automatisch abwesend ist, wird die ursprüngliche Nachricht im Text normalerweise nicht berücksichtigt. Wie können Sie die E-Mails mit der ursprünglichen Nachricht in Outlook automatisch verlassen? In diesem Artikel werde ich über einen VBA-Code sprechen, damit Sie diesen Job in Outlook so schnell wie möglich beenden können.

Automatische Antwort von E-Mails mit Originalnachricht in Outlook mit VBA-Code


Automatische Antwort von E-Mails mit Originalnachricht in Outlook mit VBA-Code

Die normale Outlook-Regel kann Ihnen beim Umgang mit Jobs nicht helfen, aber mit dem folgenden VBA-Code können Sie dies schnell und einfach beenden. Bitte machen Sie Folgendes:

1. Halten Sie die Taste gedrückt ALT + F11 Schlüssel zum Öffnen der Microsoft Visual Basic für Applikationen Fenster.

2. In dem Microsoft Visual Basic für Applikationen Fenster, Doppelklick ThisOutlookSessionn von der Projekt1 (VbaProject.OTM) Bereich, um den Modus zu öffnen, und kopieren Sie dann den folgenden Code und fügen Sie ihn in das leere Modul ein.

VBA-Code: E-Mails mit Originalnachricht automatisch beantworten:

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. Speichern und schließen Sie dann das Codefenster, schließen Sie Outlook oder starten Sie es neu, damit der VBA-Code wirksam wird. Wenn Sie jetzt E-Mails erhalten, sendet Outlook eine automatische Antwort mit der ursprünglichen Nachricht, wie im folgenden Screenshot gezeigt:


Beste Office-Produktivitätstools

Kutools for Outlook - Über 100 leistungsstarke Funktionen zur Optimierung Ihres Outlooks

🤖 KI-Mail-Assistent: Sofortige Profi-E-Mails mit KI-Magie – geniale Antworten mit einem Klick, perfekter Ton, mehrsprachige Beherrschung. Verwandeln Sie den E-Mail-Versand mühelos! ...

📧 E-Mail Automation: Abwesenheit (verfügbar für POP und IMAP)  /  Planen Sie das Senden von E-Mails  /  Automatisches CC/BCC nach Regeln beim E-Mail-Versand  /  Automatische Weiterleitung (erweiterte Regeln)   /  Begrüßung automatisch hinzufügen   /  Teilen Sie E-Mails mit mehreren Empfängern automatisch in einzelne Nachrichten auf ...

📨 E-Mail-Management: E-Mails einfach abrufen  /  Blockieren Sie betrügerische E-Mails nach Betreff und anderen  /  Doppelte E-Mails löschen  /  Erweiterte Suche  /  Ordner konsolidieren ...

📁 Anhänge ProBatch speichern  /  Stapeltrennung  /  Stapelkomprimierung  /  Automatisches Speichern   /  Automatische Trennung  /  Automatische Komprimierung ...

???? Schnittstellenmagie: 😊Mehr hübsche und coole Emojis   /  Steigern Sie Ihre Outlook-Produktivität mit Registerkartenansichten  /  Ausblick minimieren statt schließen ...

👍 Wunder mit einem Klick: Allen mit eingehenden Anhängen antworten  /   Anti-Phishing-E-Mails  /  🕘Zeitzone des Absenders anzeigen ...

👩🏼‍🤝‍👩🏻 Kontakte und Kalender: Fügen Sie Kontakte aus ausgewählten E-Mails im Stapel hinzu  /  Teilen Sie eine Kontaktgruppe in einzelne Gruppen auf  /  Geburtstagserinnerungen entfernen ...

Auf über 100 Eigenschaften Warten Sie auf Ihre Erkundung! Klicken Sie hier, um mehr zu erfahren.

 

 

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