Բաց թողնել հիմնական բովանդակությունը

Ինչպե՞ս ինքնաբերաբար ստեղծել սիրելի ուղարկողի անունը Outlook- ում հաղորդագրությունը պատասխանելիս:

Էլ.փոստի հաղորդագրությունը պատասխանելիս պետք է ձեռքով մուտքագրեք ուղարկողի անունն ու ողջույնները: Saveամանակ խնայելու և աշխատանքի արդյունավետությունը բարելավելու համար կարող եք մտածել Outlook- ում ավտոմատ կերպով ստեղծել սիրելի ուղարկողի անուն և ողջույններ: Այս հոդվածում ես կխոսեմ Outlook- ում այս առաջադրանքի լուծման մի քանի օգտակար մեթոդների մասին:

VBA կոդով հաղորդագրությունը պատասխանելիս ավտոմատ կերպով ստեղծեք սիրելի ուղարկողի անունն ու ողջույնները

Outlook- ի համար Kutools- ով հաղորդագրությունը պատասխանելիս ինքնաբերաբար ստեղծեք սիրելի ուղարկողի անուն և շնորհավորանքներ


VBA կոդով հաղորդագրությունը պատասխանելիս ավտոմատ կերպով ստեղծեք սիրելի ուղարկողի անունն ու ողջույնները

Հետևյալ VBA կոդը կարող է օգնել ձեզ ավտոմատ կերպով ներմուծել սիրելի ուղարկողի անունն ու ողջույնները էլփոստի հաղորդագրությունը պատասխանելիս, արեք հետևյալ կերպ.

1, Պահեք պահեք ALT + F11 բացել ստեղները Microsoft Visual Basic հավելվածների համար պատուհան.

2, Մեջ Microsoft Visual Basic հավելվածների համար պատուհանը, կրկնակի սեղմեք ԱյսOutlookSession- ը - ից Project1 (VbaProject.OTM) ռեժիմը բացելու պատուհանը, այնուհետև պատճենեք և կպցրեք հետևյալ կոդը դատարկ մոդուլի մեջ:

VBA կոդ. Պատասխանելիս ավտոմատ տեղադրիր սիրելի ուղարկողի անունը և ողջույնները.

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 հարգելի ուղարկողի անունը 1

3. Դրանից հետո փակեք Outlook- ը և վերագործարկեք այն ՝ կոդի էֆեկտն ստանալու համար, և այժմ, երբ էլփոստով հաղորդագրություն եք պատասխանում, սիրելի ուղարկողի անունն ու ողջույնները ավտոմատ կերպով տեղադրվում են մարմնի մեջ, տես նկարի նկարը.

doc auto հարգելի ուղարկողի անունը 2


Outlook- ի համար Kutools- ով հաղորդագրությունը պատասխանելիս ինքնաբերաբար ստեղծեք սիրելի ուղարկողի անուն և շնորհավորանքներ

Եթե ​​դուք ունեք Outlook- ի համար նախատեսված գործիքներԻր Պատասխանելիս ավելացրեք ողջույններ առանձնահատկությունը, Outlook- ը ավտոմատ կերպով կտեղադրի ուղարկողի անունը պատասխանելիս:

Outlook- ի համար նախատեսված գործիքներ : ավելի քան 100 հարմարավետ Outlook հավելումներով, 60 օրվա ընթացքում փորձեք առանց սահմանափակումների. 

Տեղադրելուց հետո Outlook- ի համար նախատեսված գործիքներխնդրում եմ արեք ինչպես դա

1: Սեղմեք Կուտոլս > Ընտրանքներ, տես նկարի նկարը.

doc auto հարգելի ուղարկողի անունը 3

2, Մեջ Ընտրանքներ երկխոսության տուփ, տակ պատասխանել էջանշանը, ստուգեք Պատասխանելիս ավելացրեք ողջույններ տարբերակը, և այնուհետև մուտքագրեք այն ողջույնները, որքան ձեզ հարկավոր է, տես նկարի նկարը.

doc auto հարգելի ուղարկողի անունը 4

3. Այնուհետեւ կտտացրեք OK այս պարամետրն ավարտելու համար, այսուհետ հաղորդագրությունը պատասխանելիս ողջույնները կստեղծվեն ավտոմատ կերպով հաղորդագրության մարմնի դիմաց, տե՛ս նկարը.

doc auto հարգելի ուղարկողի անունը 5

Կտտացրեք Kutools- ը Outlook- ի և անվճար փորձաշրջանի համար ներբեռնելու համար:


Գրասենյակի արտադրողականության լավագույն գործիքները

Outlook- ի համար նախատեսված գործիքներ - Ավելի քան 100 հզոր գործառույթ՝ ձեր Outlook-ը լիցքավորելու համար

🤖 AI Փոստի օգնական: Ակնթարթային պրոֆեսիոնալ նամակներ AI մոգությամբ. մեկ սեղմումով հանճարեղ պատասխաններ, կատարյալ հնչերանգներ, բազմալեզու վարպետություն: Փոխակերպեք էլ. փոստը առանց ջանքերի: ...

📧 Email ավտոմատացում: Գրասենյակից դուրս (հասանելի է POP-ի և IMAP-ի համար)  /  Ժամանակացույց ուղարկել նամակներ  /  Ավտոմատ CC/BCC էլփոստ ուղարկելիս կանոններով  /  Ավտոմատ փոխանցում (Ընդլայնված կանոններ)   /  Ավտոմատ ավելացնել ողջույնները   /  Ավտոմատ կերպով բաժանել բազմասերիստացող նամակները առանձին հաղորդագրությունների ...

📨 էլեկտրոնային կառավարման: Հեշտությամբ հիշեք նամակները  /  Արգելափակել խարդախության նամակները ըստ առարկաների և այլոց  /  Deleteնջել կրկնօրինակ նամակները  /  Ընդլայնված որոնում  /  Համախմբել Թղթապանակները ...

📁 Հավելվածներ ProԽմբաքանակի պահպանում  /  Խմբաքանակի անջատում  /  Խմբաքանակային կոմպրես  /  Auto Save- ը   /  Ավտոմատ անջատում  /  Ավտոմատ սեղմում ...

🌟 Ինտերֆեյս Magic: 😊Ավելի գեղեցիկ և զով էմոջիներ   /  Բարձրացրեք ձեր Outlook-ի արտադրողականությունը ներդիրներով դիտումների միջոցով  /  Նվազագույնի հասցնել Outlook-ը փակելու փոխարեն ...

???? Մեկ սեղմումով Հրաշքներ: Պատասխանել բոլորին մուտքային հավելվածներով  /   Հակաֆիշինգի էլ. նամակներ  /  🕘Ցուցադրել ուղարկողի ժամային գոտին ...

👩🏼‍🤝‍👩🏻 Կոնտակտներ և օրացույց: Խմբաքանակի ավելացրեք կոնտակտներ ընտրված էլ  /  Կոնտակտային խումբը բաժանեք առանձին խմբերի  /  Հեռացնել ծննդյան հիշեցումները ...

Over 100 Նկարագրություն Սպասեք ձեր հետազոտությանը: Սեղմեք այստեղ՝ ավելին բացահայտելու համար:

 

 

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