PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Program Addins Conditionally deleting contacts

Reply

Conditionally deleting contacts

 
Thread Tools Rate Thread
Old 14-06-2004, 11:06 AM   #1
John
Guest
 
Posts: n/a
Default Conditionally deleting contacts


Hi

Could someone please show me how to, programmatically, go through a contacts
folder called clients and clear all contacts except those that have category
personal? I have written some code (given below) but don't know how to check
for the category field of a contact item and then delete the item if it does
not have personal in the category.

Thanks

Regards

O = New Outlook.Application
F =
O.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts).Folder
s().Item("Clients")

ICount = F.Items.Count
For I = 1 To ICount
if not {check for category field of the Ith item for 'personal'} then
{Delete Ith contact item}
end if
Next I




  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off