• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 199
  • Last Modified:

Import Adresses from mail Contacts

I have a program where I want to import adresses from the users mail contacts.

Through my search I have found several examples on different ways to do this, but I lack the ability to judge which will work best for me.

I have been looking at MAPI, PIAs and Visual Studio Tool for Office.

I don't know what mail system the user has, so it need to be able to handle multible mail programs, versions and settings.

Visual Studio .NET 2005
Windows Application
C#
0
PeterSvendsen
Asked:
PeterSvendsen
  • 5
  • 5
1 Solution
 
surajgupthaCommented:
well if you already knew how to access these three systems. just add a config parameter in your config file which will determine which method to use. Just a suggestion...
0
 
PeterSvendsenAuthor Commented:
Don't think I understand your answer. Might be my question that need clearification, so here goes...

I have a program where I want to import some adresses from the mail program to a datatable.
This program is used by alot of people with different settings so I have no idea what kind of mail system is used.
My generel C# knowledge is rather low and my knowledge on Office is even lower and the knowledge on the interacting between the two is what I am working on. I have been searching around for a while but havn't found anything that sound like what I am looking for.

Someone I know have a MAPI solution in VBA where he handle several mail systems in one blow. All the MAPI examples I have found are from some years back and I get the feeling that this is done in some other way now.

If I use PIA's I get a version for each Outlook version which has lead me to believe that I have to make a solution for each possible mail program. I hope I am wrong or there is an easier way.

VSTO seem to handle multible mail systems but it seem very overkill for the task and it seem like I have to add alot of restributable files for the installation if I go this way. Have to check up on what VS license I have as well. Not sure if VSTO is included.


As you might have noticed I do not have a clear view on how these things work and might have made some wrong conclusions on the way or very possibly missed something very basic.
0
 
surajgupthaCommented:
well if you are just looking to get some information about mail contacts, you should try working on the active directory. You could query the active directory if you are sure all the mail systems have an active directory.
0
Cloud Class® Course: CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

 
PeterSvendsenAuthor Commented:
I don't know much about Active Directory, installations or the like but don't belive all the users has it.

The program run on the following platforms:
- Windows 2000
- Windows XP
- Windows Vista
- Mac Windows emulation (it is acceptable if it doen't work here)

The Windows installations cover:
- Simple home installations on private computers (no AD here to my knowledge)
- Thin clients on company network (probably with AD)
- Thick clients on company network (probably with AD)
0
 
surajgupthaCommented:
What did you mean by mail contacts? Can you explain in a little details please?
0
 
PeterSvendsenAuthor Commented:
In Outlook i have some Contacts. I want to import the information from the Address fields into a datagrid to make my program easier to use.

I have gotten it to work on my own computer with the following code but I was curious on which way would work best on a random computer.

Outlook._Application outlookObj = new Outlook.Application();
Outlook.MAPIFolder fldContacts = (Outlook.MAPIFolder)outlookObj.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
foreach (Outlook._ContactItem ci in fldContacts.Items)
{
  //Importing the Address information
}
0
 
PeterSvendsenAuthor Commented:
I can add that the program is used on above 100 different computers witch probably has all kinds of mail solutions.
I am hoping to find a bit of code that will be able handle more than one mail system without having to code up to each of them. Hopefully without having to add too much redistributable files on the way.
I don't know what's possible but thats what I am looking for.
0
 
surajgupthaCommented:
Well my guess is that if you use the outlook object and try to read the contacts it should work for most outlook versions. But lets assume that it was lotus, you might have to code it seperately for that because it is a different object model. I am 90% positive that there is no ONE way of getting info from all email clients.
0
 
PeterSvendsenAuthor Commented:
Thank you for for keeping focus. I understand that the question was a bit confusing.

Sadly my confusion on the subject is just about the same as when I started out, but you deserve the points for trying to help out.

I was trying to understand the differences between different ways to solve the mail contact interaction.
I have choosen one and hope it will work out for me.
0
 
surajgupthaCommented:
In my opinion no one can support everything. Before you start off with this you will have to decide what e-mail clients you intend to support. That way you know exactly what you are looking for.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now