Solved

Updating and Deleting items from Outlook using Visual BAsic Code

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Outlook creates tmp files 2 45
Outlook 2016 Profiles 6 41
Question about Exchange Calendar Updating 3 37
Exchange 2013 Management Shell remove automapping permissions 2 37
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Read this checklist to learn more about the 15 things you should never include in an email signature.
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: …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

809 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