473,503 Members | 972 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Direct Access to Your Outlook Address Book



MetaPro Systems Inc. Visual Studio Dot Net Tips & Tricks #3 – Direct
Access to
Your Outlook Address Book.

Project Type: VS.NET Windows Application
Code Behind: Visual Basic

I have a project where I needed to access my Outlook Address book
directly. This is possible but very tricky. I got it to work and I
would like to share it with you. Thanks go to Jim Lennox of Scientific
Solutions Inc. for helping me work this out. I would also like to site
the book "Developing Applications using Outlook 2000, CDO, Exchange and
Visual Basic" by Piemonte and Jamison as
a good source for this subject.

I have created a simple project to illustrate this principle. The
project reads the outlook address book and write name, company and email
to a text file. You can download this project from our web site at
http://www.metaprosystems.com/NetTipsTricks.htm
Here are the key portions of the code.

Dim moNS As Outlook.NameSpace
Dim mcContacts As Outlook.MAPIFolder
Dim moItems As Outlook.Items
Dim moCt As Outlook.ContactItem

moNS = mobjOutlook.GetNamespace("mapi")
mcContacts = _

moNS.GetDefaultFolder(Outlook.OlDefaultFolders.olF olderContacts)
' set to the contact folder
moItems = mcContacts.Items

moItems = moItems.Restrict("[MessageClass] = 'IPM.Contact'")
' filter to select only contact items

moItems.Sort("[EMail1Address]", False) ' sort by email address
Bob Avallone
Copyright 2003.

Comments and questions are welcome. Please forward this entire message
To friends and colleagues. To subscribe or unsubscribe to Dot Net Tips &
Tricks, send an e-mail to ti**@metaprosystems.com or call MetaPro
Systems Inc. at (781) 860-7345.

MetaPro Systems Inc. offers the following services:

* Custom Business Software running under Windows
* Web Sites using ASP.NET
* VS.NET Mentoring
* VS.NET Coaching

For more information about MetaPro’s services, visit
www.metaprosystems.com or
call (781)860-7345.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #1
0 3966

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4053
by: Iain Miller | last post by:
Currently using & developing a new application in A97. This app has a lot of Name & Address information in it. A lot of that information will be duplicated in Outlook & I suddenly wondered if its...
3
3553
by: Dan Hicks | last post by:
Hi, I wrote this test code as part of a module I created for the Northwind database. However, I was only using this as a test platform. My goal was to write a program that would take records...
1
2966
by: Lauren Quantrell | last post by:
I know if I was using an Access MDB I could link to MS Outlook folders and the addressbook. But I'm using an Access Project (ADP) and want to figure out a way to link to the Outlook addressbook...
4
3378
by: KnightKnives | last post by:
Is there anyone out there who could help me find the resources I need in order to make this application. I have done a lot of work with 2.0 engine then upgraded to 97; now have 2003. I have...
2
5122
by: charliej2001 | last post by:
Hi all Im copying details from an Outlook contact address book into an Access database. Originally I was only copying about 10 fields across, using the the following method, with a line of code...
1
4317
by: charliej2001 | last post by:
Hi all My access database has import/export capabiltiy of contact details between outlook. The database is getting big now (1000+ contacts) and so are the outlook address books that have the...
4
13916
by: Alexander Szigetvary | last post by:
Hi NG! Is there a way to open the Outlook address book dialog (as in Outlook) using C#? I am using Outlook 2003 (MS Outlook 11.0 Object Library). In Outlook 2007 it can be done with...
1
2872
by: Lpitt56 | last post by:
I am running MS Access 2007 and I want to update an Outlook Address book from my Access Database. I started out by importing the Outlook Address Book as a linked table and it linked fine. I then...
1
5567
by: Paul Brady | last post by:
This must be a common operation, but I have searched this newsgroup and have wrestled with the help messages, and I seem to need help with this simple task. I have an Access 2000 database which,...
0
7089
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7463
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.