Hi John,
O = New Outlook.Application
for setting an object variable you must write the Set instruction:
Set O = ...
For I = 1 To ICount
' Stuck here and need code help for: If categories field contains
category value 'x' then
' delete this contact
Next I
You could work with Items(I) in this case. Anyway, for object references
I´d recommend For Each:
Dim obj as Object ' Because a folder can contain different object types
_
you should declare the variable as a general object.
Dim oContact as Outlook.ContactItem
For Each obj in F.Items
If Typeof obj is Outlook.ContactItem Then
Set oContact=obj
' Now you can handle the ContactItem, use Intellisense
Endif
Next
For checking the condition please read the VBA help for the InStr
function. You could use the Object Browser, switch from <All Libraries>
to Outlook, select "ContactItem" in the left pane and "Categories" in
the right. Then press F1 for the VBA help and a code sample.