PC Review


Reply
Thread Tools Rate Thread

Direct Access to Your Outlook Address Book

 
 
Bob Avallone
Guest
Posts: n/a
 
      7th Dec 2003


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.olFolderContacts)
' 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 (E-Mail Removed) 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!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
re: cannot access wab dll address book , outlook eddy Windows XP Help 6 18th Jul 2009 04:27 PM
Empty Manager and Direct Reports fields in Outlook 2003 Address book jonatman@gmail.com Microsoft Outlook 7 29th Jun 2007 02:39 PM
How do I create a direct link to the address book from our Intrane =?Utf-8?B?TWVkaXVt?= Microsoft Outlook Interoperability 4 1st Jun 2005 10:21 PM
address book in outlook web access =?Utf-8?B?c2pz?= Microsoft Outlook Contacts 1 10th Nov 2004 09:26 PM
Outlook 03 - Cannot Access Address Book Charliec Microsoft Outlook Calendar 1 24th Feb 2004 01:47 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:16 PM.