Hallo,
hab das selbst noch nicht gebraucht… aber ich glaube man muss die gewuenschte Kategorie zu den Bestehenden hinzufuegen. Das ist eine Liste mit „,“ getrennt.
folgend ein CodeBeispiel von der Seite outlook20007.codeplex.com
====================================================
Option Explicit
'USAGE : SPECIFY THE CONTACT FOLDER AND
’ : THE CATEGORY STRING TO BE ADDED TO ALL CONTACT ITEMS
'*************************************************************
Sub SetCategory()
’ specify contact folder
Const strContactFolder As String = „LinkedIn“
’ specify category to add to each contact item in the folder
Const strCategory As String = „LinkedIn“
’ outlook App object
Dim objOutlook As Outlook.Application
’ contact folder object
Dim objContactFolder As Outlook.Folder
’ contact item object
Dim objContactItem As Outlook.ContactItem
’ error handler
On Error GoTo ErrorHandle:
'set outlook application object
Set objOutlook = New Outlook.Application
With objOutlook.GetNamespace(„MAPI“)
’ confirm the operation or cancel
If MsgBox(„Procedure will add the Category [“ & strCategory & „] to the folder [“ & _
strContactFolder & „]. Do you want to proceed?“, vbYesNo) vbYes Then GoTo Exiting:
'set contact folder object
With .GetDefaultFolder(olFolderContacts)
Set objContactFolder = .Folders.Item(strContactFolder)
End With
’ add Category to each contact item in specified folder
For Each objContactItem In objContactFolder.Items
’ check if category already exists for the item
If InStr(1, objContactItem.Categories, strCategory, vbTextCompare)