How to Batch Apply the Same Business Address to All Outlook Contacts in the Same Company

The contacts of the same company usually have the same business address. Hence, when adding business address to the contacts, you may long for a solution to batch add a specific one to all contacts of a specific company. Now, this article will expose such a method to you.

Generally, if you want to add the business address information to a contact, you have to firstly open this contact. In this way, if you want to add business address to multiple contacts, it will be quite cumbersome. Therefore, for instance, if you’d like to bulk add a specific business address to all contacts of a certain company, you must look forward to a more convenient way. Looking at this need, here we’ll introduce such an approach to you.

Batch Apply the Same Business Address to All Outlook Contacts in the Same Company

Batch Apply the Same Business Address to All Contacts in the Same Company

  1. At the very beginning, start your Outlook application.
  2. Then, access Outlook VBA editor according to the previous article – “How to Run VBA Code in Your Outlook”.
  3. Next, in the new “Microsoft Visual Basic for Applications” window, copy and paste the following VBA code into an empty project or module.
Dim strBusinessAddress, strCompany As String

Sub AddBusinessAddress_AllContacts_SpecificCompany()
    Dim objStore As store
    Dim objFolder As Folder
 
    'Input the specific business address and company name
    strBusinessAddress = InputBox("Input the business address.")
    strCompany = InputBox("Input the specific company name.")
 
    If Trim(strBusinessAddress) <> "" And Trim(strCompany) <> "" Then
 
       'Process all Contact folder in your Outlook
       For Each objStore In Application.Session.Stores
           For Each objFolder In objStore.GetRootFolder.Folders
               If objFolder.DefaultItemType = olContactItem Then
                  Call ProcessFolders(objFolder)
               End If
           Next
       Next
       MsgBox "Completed!", vbInformation + vbOKOnly
    End If
End Sub

Sub ProcessFolders(ByVal objCurrentFolder As Folder)
    Dim objItem As Object
    Dim objContact As ContactItem
 
    'Add the business address to all contacts of the specific company
    For Each objItem In objCurrentFolder.Items
        If objItem.Class = olContact Then
           Set objContact = objItem
           If objContact.CompanyName = strCompany Then
              'If objContact.BusinessAddress = "" Then
                 objContact.BusinessAddress = strBusinessAddress
                 objContact.Save
              'End If
           End If
        End If
    Next
 
    'Process all subfolders recursively
    If objCurrentFolder.Folders.Count > 0 Then
       For Each objSubFolder In objCurrentFolder.Folders
           Call ProcessFolders(objSubFolder)
       Next
    End If
End Sub

VBA Code - Batch Apply the Same Business Address to All Contacts in the Same Company

  1. After that, click into the “AddBusinessAddress_AllContacts_SpecificCompany” subroutine, namely putting cursor in it.
  2. Later, run this macro by “F5” key button.
  3. Subsequently, you ought to specify the business address as and the company.Specify Business Address and Company
  4. When macro finishes, you will get the message prompting “Completed!”
  5. At present, you can turn to the contact list. All the contacts of the specific company must have the same business address, like the picture below:Changed Business Addresses

Restore Outlook Data in the Event of Corruption

Outlook corruption has plagued a great number of users for a long time. Hence, it is essential for you, a regular Outlook user, to learn some tips to cope with such a vexing issue. Usually, at first, you can check if your Outlook data backup contains the updated data. If fails, you can try the inbuilt repair tool – Scanpst. Moreover, a powerful 3rd party fix tool, like DataNumen Outlook Repair, is also a good option.

Author Introduction:

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

Leave a Reply

Your email address will not be published. Required fields are marked *