Solved

Updating and Deleting items from Outlook using Visual BAsic Code

Posted on 2001-06-13
1
173 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Resolve DNS query failed errors for Exchange
Outlook Free & Paid Tools
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
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…

862 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

Need Help in Real-Time?

Connect with top rated Experts

29 Experts available now in Live!

Get 1:1 Help Now