I founded a way how to get this, here is it at a demo app:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Outlook = Microsoft.Office.Interop.Outlook;
namespace Contacter
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void getContacts_Click(object sender, EventArgs e)
{
// Obtain an instance of the Outlook application
Outlook.Application app = new Outlook.ApplicationClass();
// Access the MAPI namespace
Outlook.NameSpace ns = app.GetNamespace("MAPI");
// Get the user's default contacts folder
Outlook.MAPIFolder contacts =
ns.GetDefaultFolder(Outlook.OlDefaultFolders.olFol derContacts);
// Iterate through each contact
for (int i = 1; i < contacts.Items.Count + 1; i++)
{
// Get a contact
Outlook.ContactItem contact =
(Outlook.ContactItem)contacts.Items[i];
txtResults.Text += contact.FullName + " (" +
contact.BusinessTelephoneNumber + ")" + Environment.NewLine;
Application.DoEvents();
}
}
}
}
thx
Volkan
"Volkan Senguel" <mo******@2wire.chschrieb im Newsbeitrag
news:OU**************@TK2MSFTNGP04.phx.gbl...
Hi
Is there a easy way to get the contacts (names and phonenumbers) from
outlook without the message that someone is accessing outlook and how long
the access can take?
i have not found any working solution for that :(
thanks for any help
Volkan