How to Auto Link Appointments with Related Contacts in Outlook

Outlook permits users to link any items with any contacts. Now, in this post, we will make this feature much more intelligent. It will auto identify the related contacts from the new appointments and link them.

As normal, to link an appointment with contacts manually in Outlook, you should firstly enable “Show contacts linked with the current item” feature in “Outlook Options”. Then, after opening an appointment, you will see a “Contacts” button at the bottom. You can click on it to select the related contacts to be linked with. If you still feel it troublesome and hope that Outlook can auto accomplish the link, you can use the following method.

Auto Link Appointments with Related Contacts in Outlook

Auto Link Appointments with Related Contacts

  1. To begin with, start your Outlook program.
  2. Then, press “Alt + F11” shortcut keys to access Outlook VBA editor.
  3. In the subsequent “Microsoft Visual Basic for Applications” window, you have to double click on the “ThisOutlookSession” project on the left side.
  4. Next, in the opened project window, copy and paste the following VBA code.
Public WithEvents objAppointments As Outlook.Items

Private Sub Application_Startup()
    Set objAppointments = Application.Session.GetDefaultFolder(olFolderCalendar).Items
End Sub

'Occurs when creating a new appointment
Private Sub objAppointments_ItemAdd(ByVal Item As Object)
    Dim strSubject, strBody As String
    Dim objContacts As Outlook.Items
    Dim i As Long
    Dim objContact As Outlook.ContactItem
 
    strSubject = Item.Subject
    strBody = Item.Body
 
    'Get the Contacts
    Set objContacts = Application.Session.GetDefaultFolder(olFolderContacts).Items
 
    For i = objContacts.Count To 1 Step -1
        If objContacts(i).Class = olContact Then
           Set objContact = objContacts(i)
  
           'Search the new appointment subject & body for each contact’s first name
           If (InStr(1, LCase(strSubject), LCase(objContact.FirstName), vbTextCompare) > 0) Or _
              (InStr(1, LCase(strBody), LCase(objContact.FirstName), vbTextCompare) > 0) Then
 
              'Link the new appointment with the specific contacts
              Item.links.Add objContact
              Item.Save
           End If
        End If
    Next i
End Sub

VBA Code - Auto Link Appointments with Related Contacts

  1. After that, you ought to assign a digital certificate to this new project.
  • First off, click on the “Tools” button in the ribbon.
  • Then, from the drop down list, choose “Digital Signature” option.
  • Next, in the new dialog box, you could follow the onscreen instructions to complete this task.
  1. Later, you can exit the current window by click the “X” icon in the upper right corner.
  2. Subsequently, you have to make sure that your Outlook has enabled digitally signed macros in “Trust Center”.
  3. Finally, you can restart your Outlook application to activate the new project.
  4. Since then, each time when you create a new appointment, Outlook will auto detect the relevant contacts and link it, like the screenshot below:Linked Contacts in Appointments

Fix Outlook Errors with ScanPST

It’s very common to suffer various errors in Outlook. Fortunately, Outlook comes packed with an inbuilt fix tool – Scanpst. Therefore, normally, once encountering any issues, the first choice must be to utilize this internal tool. However, it is still helpless in case of serious troubles, like severe Outlook corruption. At that point, your last resort is to employ a more eminent and powerful tool, say DataNumen Outlook Repair. It can recover PST from issues without any hassles.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including mdf recovery and outlook repair software products. For more information visit www.datanumen.com

Comments are closed.