Opening Outlook address book

  • Thread starter Thread starter Alexander Szigetvary
  • Start date Start date
A

Alexander Szigetvary

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 SenderNameDialog. I need to support both
versions.

Any hints?

TIA

Alex
 
Here is how to open the Contacts list or Address book:

private Outlook.Application outlook;
private void button1_Click(object sender, System.EventArgs e)
{
try
{
outlook = new Outlook.Application();
Outlook.NameSpace mapiNamespace = outlook.GetNamespace("MAPI");
Outlook.MAPIFolder mapiFolder =
mapiNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
mapiFolder.Display();
}
catch(Exception ex)
{
Debug.WriteLine(ex.Message);
}
}

Adrian.
 
Hi Adrian,
private Outlook.Application outlook;
private void button1_Click(object sender, System.EventArgs e)
{
try
{
outlook = new Outlook.Application();
Outlook.NameSpace mapiNamespace = outlook.GetNamespace("MAPI");
Outlook.MAPIFolder mapiFolder =
mapiNamespace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderContacts);
mapiFolder.Display();
}
catch(Exception ex)
{
Debug.WriteLine(ex.Message);
}
}

Not quite what I was looking for. I am trying to open the Outlook address
book, that shows the global address list and all outlook address book lists,
like subfolders to contacts or even public Exchange folders.

I know a way for Outllok 2007, but that doesn't work in Outlook 2003. So I'm
looking for that.

Alex
 
I'm not sure if that is possible with Outlook 2003 and earlier. I can't find
anything on the web relating to it but I could be wrong. You could just parse
the address list in code and fill up a list box with the contacts then handle
the double click event on the list box to add the user to an email.

Adrian.
 
I'm not sure if that is possible with Outlook 2003 and earlier. I can't
find
anything on the web relating to it but I could be wrong. You could just
parse
the address list in code and fill up a list box with the contacts then
handle
the double click event on the list box to add the user to an email.

not quite the answer I hoped for, but thanks anyway.

In my first version I used CDO 1.21, which makes it easy to do that. My
problem is that the app just runs locally, but not when the exe is on a
network share (though the app is full trust).
And obviously MS says that CDO 1.x is not supported in managed code. Too bad
....

Alex
 
Hi,

I am looking for the same functionality in Outlook 2007. Can you please tell me how you have implemented for outlook 2007?

Thank you,
Manoj
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 SenderNameDialog. I need to support both
versions.

Any hints?

TIA

Alex
 
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 SenderNameDialog. I need to support both
versions.

Any hints?

TIA

Alex

Hi,

I want to open outlook global address list window from my windows application. outlook version is 2007. could you please tell me how you have implemented?

Thank you,
Manoj
 
Back
Top