• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved outlook2010 question

Saeud

New Pleskian
Hello,

I have quite a few contact groups, and I set different color categories for different contact groups. And I also set the color categories to the group members as same as their contact group color. But it seem that I need to set the color categories for the group members one by one manually.

Can outlook auto set the same contact categories to the group members when I set the color ategories for the contact group? Any way to do that?
 
Hi,

There is no such fuction in outlook to do that. But you can use VBA macro to do that. Try the codes below.

Code:
Public WithEvents objExplorer As Outlook.Explorer
Public WithEvents objContactGroup As Outlook.DistListItem
Public objCurrentFolder As Outlook.Folder

Private Sub Application_Startup()
    Set objExplorer = Outlook.Application.ActiveExplorer
End Sub

Private Sub objExplorer_Activate()
    On Error Resume Next
    If TypeOf objExplorer.Selection.Item(1) Is DistListItem Then
       Set objContactGroup = objExplorer.Selection.Item(1)
    End If
 
    Set objCurrentFolder = objExplorer.CurrentFolder
End Sub

Private Sub objContactGroup_PropertyChange(ByVal Name As String)
    Dim strCategories As String
    Dim objCurrentFolderContacts As Outlook.Items
    Dim objDefaultFolderContacts As Outlook.Items
    Dim i As Long
    Dim objMemeber As Object
    Dim strFilter As String
    Dim objFoundContact As Outlook.ContactItem
 
    If Name = "Categories" Then
       'Get the categories of the selected contact group
       strCategories = objContactGroup.Categories
 
       'Find the contacts in the current folder and default "Contacts" folder
       Set objCurrentFolderContacts = objCurrentFolder.Items.Restrict("[Email1Address]>''")
       Set objDefaultFolderContacts = Application.Session.GetDefaultFolder(olFolderContacts).Items.Restrict("[Email1Address]>''")
 
       For i = objContactGroup.MemberCount To 1 Step -1
           'Find the contacts corresponding to the group members
           Set objMember = objContactGroup.GetMember(i)
 
           strFilter = "[Email1Address] = '" & objMember.Address & "'"
           Set objFoundContact = objCurrentFolderContacts.Find(strFilter)
 
           If objFoundContact Is Nothing Then
              Set objFoundContact = objDefaultFolderContacts.Find(strFilter)
           End If
 
           'Set the same categories to the contacts
           If Not (objFoundContact Is Nothing) Then
              objFoundContact.Categories = objFoundContact.Categories & ";" & strCategories
              objFoundContact.Save
           End If
      Next
    End If
End Sub

And I also attche the artice here which you can find more detailed steps.

How to Auto Apply the Same Color Category to All Members when Categorizing a Contact Group in Outlook - Data Recovery Blog

Good luck
 
Back
Top