Solved

Updating and Deleting items from Outlook using Visual BAsic Code

Posted on 2001-06-13
1
172 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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Learn more about how the humble email signature can be used as more than just an electronic business card. When used correctly, a signature can easily be tailored for different purposes by different departments within an organization.
Resolve DNS query failed errors for Exchange
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 …
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

772 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

12 Experts available now in Live!

Get 1:1 Help Now