You can set the Parent Account field on contacts in Microsoft Dynamics CRM, however the name of the Parent Account does NOT automatically populate the Company Name field on contacts in Microsoft Office Outlook 2003.
This article contains the steps that are required to create a custom macro in Outlook 2003 that will copy the name of the Parent Account from the Microsoft CRM contact to the Company Name field on the Outlook 2003 contact.
The macro runs when Outlook 2003 starts and then watches the contact list via event handlers for any additions and/or changes. There is also a manual version of the synchronisation that can be run if in case the synchronisation is out of time. When you run the manual synchronisation, the Company Name field will be populated for all the Outlook 2003 contacts associated to a Microsoft CRM contact.
For testing, you will need to lower the Outlook 2003 macro security settings by following the below instructions:
1. In Outlook 2003, click Tools, click Macro, and then click Security.
2. In the security window, mark Low.
Note: This setting is not recommended for standard use. However, the setting is required to enable the macro to run successfully. An alternative to running the macro in the Low security mode is to digitally sign the VBA code. As soon as the code is signed, you will be able to run the macro in a higher security mode.
3. Click OK to accept the security changes.
4. Close and then restart Microsoft Outlook to set the security mode.
Follow these steps to create the macro:
1. Open Outlook 2003.
2. Click Tools on the Microsoft Outlook Toolbar, point to Macro, and then click Visual Basic Editor.
3. In the Project Explorer, expand Project1, expand Microsoft Office Outlook Objects, and then double-click the ThisOutlookSession built-in module.
4. In the ThisOutlookSession Module, paste the following code into the code window:
Dim olApp As New Outlook.Application
Public WithEvents myContacts As Outlook.Items
Public blnAlert As Boolean
Public Sub CompanyName_Sync()
Dim objContact As ContactItem
For Each objContact In myContacts
If blnAlert Then
MsgBox ("Synch Completed")
Private Sub Application_Startup()
blnAlert = False
blnAlert = True
Private Sub myContacts_ItemChange(ByVal Item As Object)
Private Sub myContacts_ItemAdd(ByVal Item As Object)
Private Sub Initialise_Handlers()
Set myContacts = olApp.GetNamespace("MAPI").GetDefaultFolder(olFolderContacts).Items
Private Sub SyncCompanyName(ByRef Item As Object)
If Not Item.UserProperties.Item("Parent Account") Is Nothing Then
Dim strParentAcct As String, strCompanyName As String
strCompanyName = Item.CompanyName
strParentAcct = Item.UserProperties.Item("Parent Account")
If strParentAcct <> "" And Item.MessageClass = "IPM.Contact" And strCompanyName <> strParentAcct Then
Item.CompanyName = strParentAcct
5. Save the Project and close the VBA editor.
Restart Outlook. Navigate to the contacts list and all the CRM contacts should now have the company name field populated with the Microsoft CRM parent account data.
New contacts added to the list will also have the company name field populated.
Any attempts to change the company name field will overwrite the changes and replace them with the Microsoft CRM parent account data.
This macro will only run, whenever you open the outlook. YOu can also manually run this macro by going to tools--> macros--> macros in outllook. Then macro name and ckick on Run.