473,320 Members | 1,876 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

unable to access information from Outlook AddressBook

1
Following is the piece of code i got from this forum itself but stil i am not able to get the full details of recepients like location,office number.

plz help me to access that information..

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using MAPI;
using System.Reflection;
using Outlook = Microsoft.Office.Interop.Outlook;

namespace Sample1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Search_Click(object sender, EventArgs e)
{
try
{

MAPI.SessionClass oSession = new MAPI.SessionClass();
oSession.Logon("Gnana",
System.Reflection.Missing.Value, true, true,
System.Reflection.Missing.Value, false, System.Reflection.Missing.Value);



MAPI.Recipients oRecipients = null;
MAPI.Recipient oRecipient = null;
MAPI.AddressEntry oAddressEntry = null;

// Display dialog box to select recipient(s)
// Watch the wrapping on this next line, everything needs to be on one line.
oRecipients = (MAPI.Recipients)oSession.AddressBook(System.Refle ction.Missing.Value,"Select Name", true, true, -1, "", "", "", 0);




for(int i = 1; i <= (int)oRecipients.Count; i++)
{
// Do what you need with Recipient, or AddressEntry
oRecipient = (MAPI.Recipient)oRecipients.get_Item(i);

// MAPI.AddressList oadd=(MAPI.AddressList)oRecipients.

oAddressEntry = (MAPI.AddressEntry)oRecipient.AddressEntry;

MessageBox.Show(oRecipient.Address.ToString());

MessageBox.Show(oAddressEntry.Name.ToString());

}

oSession.Logoff();


}
catch (Exception et)
{
MessageBox.Show(""+et);
}

}
}
}
Apr 10 '07 #1
0 1855

Sign in to post your reply or Sign up for a free account.

Similar topics

1
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
by: Ecohouse | last post by:
I need to be able to access an Outlook folder and read each email and pull data from the email into tables in Access and move the email to another folder. I now about automation but am not sure...
16
by: Serdar Kalaycý | last post by:
Hi everybody, My problem seems a bit clichè but I could not work around. Well I read lots of MSDN papers and discussions, but my problem is a bit different from them. When I tried to run the...
0
by: Chris Fink | last post by:
I have walked through all of the WSE 3 Hands on Labs and got everything working fine. When I create my own certificate and install it in the stores, my client application that is consuming my WSE...
6
by: Fabian Braennstroem | last post by:
Hi, I want to get access to my abook address file with python. Does anyone have some python lines to achive this using curses? If not, maybe anybody has small python program doing it with a...
10
by: Walshi | last post by:
Hi all, I'm a relative newby to access and VBA etc. My forms and tables etc are working great and saving lots of time...However... I have two databases with the exact same table format. I want...
2
by: hotelinfoline | last post by:
I want to get outlook express (not microsoft outlook express) address book address's in visual basic application. Please tell how I can get.
0
by: mkhan | last post by:
Hi, i have been having trouble how to open the To Contacts list (address book) of a mail message in outlook using vb.net from where the user would be able to select a email address and would be...
0
by: mkhan | last post by:
Hi, i have been having trouble how to open the 'To' Contacts list(Cc or To) (address book) of a mail message in outlook using vb.net from where the user would be able to select an email address and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.