Solved

Updating and Deleting items from Outlook using Visual BAsic Code

Posted on 2001-06-13
1
177 Views
Last Modified: 2010-04-08
I want to delete the contacts existing in Contact folder of MS Outlook by writing a code in Visual Basic
and also update and item in the contact folder.

I am able to delete if the item is exisiting in a user created folder using the below given code, but
I want it for the default folders

Set ol = New Outlook.Application
  Set olns = ol.GetNamespace("MAPI")
  Set TestFolder = olns.GetDefaultFolder(olFolderInbox).Folders("test")
  Set TestItems = TestFolder.Items
  NumItems = TestItems.Count
  For I = NumItems To 1 Step -1
     TestItems(I).Delete
  Next


Cn any one help
0
Comment
Question by:gondesiravi
1 Comment
 
LVL 9

Accepted Solution

by:
rjcpjc earned 20 total points
ID: 6186907
Not sure what you are asking.  If you want to reference the default contact folder use the following line.

Set TestFolder = olns.GetDefaultFolder(olFolderContacts)
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question