Direkt zum Inhalt

Wie erstelle ich automatisch den Namen eines lieben Absenders, wenn ich eine Nachricht in Outlook beantworte?

Wenn Sie eine E-Mail-Nachricht beantworten, sollten Sie den Namen und die Begrüßungen des Absenders manuell eingeben. Um Zeit zu sparen und die Arbeitseffizienz zu verbessern, können Sie den Namen und die Begrüßungen eines lieben Absenders automatisch in Outlook erstellen. In diesem Artikel werde ich einige nützliche Methoden zum Lösen dieser Aufgabe in Outlook erläutern.

Erstellen Sie automatisch den Namen und die Grüße eines lieben Absenders, wenn Sie eine Nachricht mit VBA-Code beantworten

Erstellen Sie automatisch den Namen und die Grüße eines lieben Absenders, wenn Sie eine Nachricht mit Kutools for Outlook beantworten


Erstellen Sie automatisch den Namen und die Grüße eines lieben Absenders, wenn Sie eine Nachricht mit VBA-Code beantworten

Der folgende VBA-Code kann Ihnen dabei helfen, den Namen und die Grüße eines lieben Absenders beim Beantworten einer E-Mail-Nachricht automatisch einzufügen. Gehen Sie dazu folgendermaßen vor:

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 DieseOutlookSession von dem 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: Fügen Sie automatisch den Namen und die Grüße eines lieben Absenders ein, wenn Sie antworten:

Public WithEvents GExplorer As Outlook.Explorer
Public WithEvents GMailItem As Outlook.MailItem
Private Sub Application_Startup()
    Set GExplorer = Outlook.Application.ActiveExplorer
End Sub
Private Sub GExplorer_SelectionChange()
    Dim xItem As Object
    On Error Resume Next
    Set xItem = GExplorer.Selection.Item(1)
    If xItem.Class <> olMail Then Exit Sub
    Set GMailItem = xItem
End Sub
Private Sub GMailItem_Reply(ByVal Response As Object, Cancel As Boolean)
    AutoAddGreetingToReply Response
End Sub
Private Sub GMailItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)
    AutoAddGreetingToReply Response
End Sub
Sub AutoAddGreetingToReply(Item As Object)
    Dim xGreetStr As String
    Dim xReplyMail As MailItem
    Dim xSenderName As String
    Dim xRecipient As Recipient
    On Error Resume Next
    If Item.Class <> olMail Then Exit Sub
    Set xReplyMail = Item
    For Each xRecipient In xReplyMail.Recipients
        If xSenderName = "" Then
            xSenderName = xRecipient.Name
        Else
            xSenderName = xSenderName & "," & xRecipient.Name
        End If
    Next xRecipient
    Select Case Time
           Case 0.3 To 0.5
                xGreetStr = " Good morning!"
           Case 0.5 To 0.75
                xGreetStr = " Good afternoon!"
           Case Else
                xGreetStr = " Good evening!"
    End Select
    With xReplyMail
        .Display
        .HTMLBody = "<HTML><Body>Dear " & xSenderName & ",</HTML></Body>" & xGreetStr & .HTMLBody
    End With
End Sub

doc auto lieber Absendername 1

3. Schließen Sie dann Outlook und starten Sie es neu, um den Codeeffekt zu erzielen. Wenn Sie nun eine E-Mail-Nachricht beantworten, werden der Name und die Grüße eines lieben Absenders automatisch in den Text eingefügt (siehe Abbildung):

doc auto lieber Absendername 2


Erstellen Sie automatisch den Namen und die Grüße eines lieben Absenders, wenn Sie eine Nachricht mit Kutools for Outlook beantworten

Wenn Sie Kutools for OutlookMit seinen Begrüßung bei Antwort hinzufügen In dieser Funktion fügt Outlook beim Antworten automatisch den Namen des Absenders ein.

Kutools for Outlook : Mit mehr als 100 praktischen Outlook-Add-Ins können Sie es innerhalb von 60 Tagen ohne Einschränkung testen. 

Nach der Installation Kutools for Outlook, bitte mach das wie folgt:

1. Klicken Sie Kutoolen > Optionen, siehe Screenshot:

doc auto lieber Absendername 3

2. In dem Optionen Dialogfeld unter antworten Registerkarte, überprüfen Begrüßung bei Antwort hinzufügen Option, und geben Sie dann die Begrüßungen nach Bedarf ein, siehe Screenshot:

doc auto lieber Absendername 4

3. Dann klick OK Um diese Einstellung zu beenden, werden von nun an beim Beantworten einer Nachricht die Begrüßungen automatisch vor dem Nachrichtentext erstellt (siehe Abbildung):

doc auto lieber Absendername 5

Klicken Sie hier, um Kutools für Outlook herunterzuladen und jetzt kostenlos zu testen!


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 (12)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi skyyang,

I need the macro to insert only the first name of the person I receive the email from. Not all the names from CC, but not to remove anyone. Also, to maintain my default color scale (R: 31, G: 73, B: 125) and font size (11 pt) with an additional line after the sender name. Please help me with this. Thanks in advance
This comment was minimized by the moderator on the site
Bonjour,
Puis je avoir le code VBA pour insérer "Bonjour prénom," seulement ???

Merci de votre aide.
This comment was minimized by the moderator on the site
Hello, Nicolas
Please apply the below code:
Public WithEvents GExplorer As Outlook.Explorer
Public WithEvents GMailItem As Outlook.MailItem
Private Sub Application_Startup()
    Set GExplorer = Outlook.Application.ActiveExplorer
End Sub
Private Sub GExplorer_SelectionChange()
    Dim xItem As Object
    On Error Resume Next
    Set xItem = GExplorer.Selection.Item(1)
    If xItem.Class <> olMail Then Exit Sub
    Set GMailItem = xItem
End Sub
Private Sub GMailItem_Reply(ByVal Response As Object, Cancel As Boolean)
    AutoAddGreetingToReply Response
End Sub
Private Sub GMailItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)
    AutoAddGreetingToReply Response
End Sub
Sub AutoAddGreetingToReply(Item As Object)
    Dim xReplyMail As MailItem
    Dim xSenderName As String
    Dim xRecipient As Recipient
    On Error Resume Next
    If Item.Class <> olMail Then Exit Sub
    Set xReplyMail = Item
    For Each xRecipient In xReplyMail.Recipients
        If xSenderName = "" Then
            xSenderName = xRecipient.Name
        Else
            xSenderName = xSenderName & "," & xRecipient.Name
        End If
    Next xRecipient
    With xReplyMail
        .Display
        .HTMLBody = "<HTML><Body>Dear " & xSenderName & ",</HTML></Body>" & .HTMLBody
    End With
End Sub

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Hi.
What do i need to edit in the VBA code to include first name only and to omit the "(s)" after Dear?
Thanks
This comment was minimized by the moderator on the site
Hello, Matt,
To solve your problem, the follwoing VBA code may do you a favor:
Public WithEvents GExplorer As Outlook.Explorer
Public WithEvents GMailItem As Outlook.MailItem
Private Sub Application_Startup()
  Set GExplorer = Outlook.Application.ActiveExplorer
End Sub
Private Sub GExplorer_SelectionChange()
  Dim xItem As Object
  On Error Resume Next
  Set xItem = GExplorer.Selection.Item(1)
  If xItem.Class <> olMail Then Exit Sub
  Set GMailItem = xItem
End Sub
Private Sub GMailItem_Reply(ByVal Response As Object, Cancel As Boolean)
  AutoAddGreetingToReply Response
End Sub
Private Sub GMailItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)
  AutoAddGreetingToReply Response
End Sub
Sub AutoAddGreetingToReply(Item As Object)
  Dim xGreetStr As String
  Dim xReplyMail As MailItem
  Dim xSenderName As String
  Dim xRcpName As String
  Dim xRecipient As Recipient
  Dim xContactItem As ContactItem
  Dim xExUser As ExchangeUser
  On Error Resume Next
  If Item.Class <> olMail Then Exit Sub
  Set xReplyMail = Item
  xSenderName = ""
  xRcpName = ""
  For Each xRecipient In xReplyMail.Recipients
    Set xExUser = Nothing
    Set xContactItem = Nothing
    If xRecipient.AddressEntry.AddressEntryUserType < 6 Then
      Set xExUser = xRecipient.AddressEntry.GetExchangeUser
    Else
      Set xContactItem = xRecipient.AddressEntry.GetContact
    End If
    If Not xExUser Is Nothing Then
      If xSenderName = "" Then
        xSenderName = xExUser.FirstName
        If xSenderName = "" Then
          xSenderName = xRecipient.Name
        End If
      Else
        xSenderName = xSenderName & ", " & xExUser.FirstName
        If xExUser.FirstName = "" Then
          xSenderName = xSenderName & xRecipient.Name
        End If
      End If
    ElseIf Not xContactItem Is Nothing Then
      If xSenderName = "" Then
        xSenderName = xContactItem.FirstName
        If xSenderName = "" Then
          xSenderName = xRecipient.Name
        End If
      Else
        xSenderName = xSenderName & ", " & xContactItem.FirstName
        If xRecipient.FirstName = "" Then
          xSenderName = xSenderName & xRecipient.Name
        End If
      End If
    Else
      If xSenderName = "" Then
        xSenderName = xRecipient.Name
      Else
        xSenderName = xSenderName & ", " & xRecipient.Name
      End If
    End If
  Next xRecipient
  Select Case Time
    Case 0.3 To 0.5
      xGreetStr = " Good morning!"
    Case 0.5 To 0.75
      xGreetStr = " Good afternoon!"
    Case Else
      xGreetStr = " Good evening!"
  End Select
  With xReplyMail
    .Display
    .HTMLBody = "<HTML><Body>Dear " & xSenderName & ",</HTML></Body>" & xGreetStr & .HTMLBody
  End With
End Sub

Please have a try, hope it can help you!
This comment was minimized by the moderator on the site
Hello
Thank you for the suggestions, although it does not work. I wish to include the first name only and to omit the "(s)" after Dear?
This comment was minimized by the moderator on the site
Hello, Matt,
The above code works well.
First, you must make sure the recipient address has been added into the Contact folder in your Outlook.
If the recipient isn't in the Contact folder, when you applying this code, the full nae will be displayed.
Thank you!
This comment was minimized by the moderator on the site
Hello

Thank you for your reply! I will add contacts to my folder. I was wondering if there is a way to always display the first name only, even without contacts within my folder. For context, I work at a large university, and would be difficult and time-consuming to find all staff members individually.
This comment was minimized by the moderator on the site
Hello, Matt,

Sorry, if you haven't added the contact to the contact folder, the code will not get the recipient's first name.
Thank you!
This comment was minimized by the moderator on the site
Hi.
What do i need to edit in the VBA code to include first name only and to omit the "(s)" after Dear?
Thanks
This comment was minimized by the moderator on the site
Dear Team,

If I have set up the above configuration however, if I am replying to an email that has multiply recipients in the To, the greeting is not defaulting. How do I achieve this?
This comment was minimized by the moderator on the site
Hello, Wesley,
Yes, as you said, if there are multiple recipients in the To field, the greeting will not be inserted by default.
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations