How to Auto Sync New Contacts to another Contacts Folder in Outlook

Some users desire that new contacts can be automatically added to two or more folders in their Outlook. So, this article will share a way to auto sync new contacts to another contacts folder.

Perhaps you have configured several email accounts in your Outlook. And each of them has its own Contacts folder. In such a case, when you create a contact in one folder, you may wish to sync it to the Contacts folders of other email accounts, too. Why not let Outlook auto accomplish it? Here we’ll teach you how to realize it.

Auto Sync New Contacts to another Contacts Folder in Outlook

Auto Sync New Contacts to another Contacts Folder

  1. At the very outset, you need to launch your Outlook program.
  2. Then, in the main Outlook window, press the shortcut keys – “Alt + F11”.
  3. Next, you will enter the “Microsoft Visual Basic for Applications” window, in which you ought to find and open the “ThisOutlookSession” project.
  4. Subsequently, copy the following VBA code and paste it into the project.
Public WithEvents objSourceFolder As Outlook.Folder
Public WithEvents objContacts As Outlook.Items

Private Sub Application_Startup()
    'Get the source Contacts folder
    Set objSourceFolder = Application.Session.GetDefaultFolder(olFolderContacts)
    Set objContacts = objSourceFolder.Items
End Sub

'Occurs when new item is added to the source folder
Private Sub objContacts_ItemAdd(ByVal Item As Object)
    Dim objContact As Outlook.ContactItem
    Dim objTargetFolder As Outlook.Folder
    Dim objCopiedContact As Outlook.ContactItem
 
    If TypeOf Item Is ContactItem Then
       Set objContact = Item
 
       'Specify the target Contacts folder
       '"Personal" refers to the displaying name of target Outlook file
       On Error Resume Next
       Set objTargetFolder = Application.Session.Folders("Personal").Folders("Contacts").Folders("From John Smith")
       If objTargetFolder Is Nothing Then
          Set objTargetFolder = Application.Session.Folders("Personal").Folders("Contacts").Folders.Add("From John Smith")
       End If
 
       'Copy the new contact
       Set objCopiedContact = objContact.Copy
       'Move copied contact to the target folder
       objCopiedContact.Move objTargetFolder
    End If
End Sub

VBA Code - Auto Sync New Contacts to another Contacts Folder

  1. After that, you need sign this code. Just click the “Tools” button in the toolbar and then select “Digital Signature”. In the popup dialog box, just follow the onscreen instructions.
  2. Later you can exit the current window and alter your Outlook macro settings to permit digitally signed macros.
  3. Lastly, you could restart your Outlook to activate this new macro.
  4. From now on, each time when a new contact is added to the source folder, it will be automatically synced to the predefined target folder.

React to Frequent Outlook Problems

Provided that you have utilized Outlook for decades, you must have met up with a variety of issues, including Outlook freezing and frequent error messages and PST file damage and so forth. Generally, you can try to solve them by restarting Outlook in safe mode, creating a new Outlook profile, disabling faulty add-ins, etc. Of course, you could take aid of a potent repair tool, such as DataNumen Outlook Repair. It can fix PST errors like a cork.

Author Introduction:

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

Comments are closed.