?
Solved

How do I colaborate with Exchange though c#?

Posted on 2011-03-02
3
Medium Priority
?
361 Views
Last Modified: 2013-12-17
I want to be able to connect to some exchange account and add/remove given appointments. What do I use to do that? I found some solutions using CDOEX Library but it seems like it's  no longer supported with 2010.
0
Comment
Question by:joein610
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 2

Expert Comment

by:pchui
ID: 35024155
If you are writing a server application, your best best is use the Exchange Web Services. EWS is intended to replace a myriad of partial Exchange APIs (CDO, CDOEX, ExOLEDB, WebDav, Exchange store event sinks). Even most MAPI tasks can be replaced with EWS.

Microsoft has created managed code wrappers to make EWS easier to work with:
http://msdn.microsoft.com/en-us/library/dd633709(v=exchg.80).aspx

Here's some sample code for creating appointments with the EWS managed API:
http://msdn.microsoft.com/en-us/library/dd633661(v=exchg.80).aspx

If you're writing a client application, then there's still the Outlook Object Model.
0
 

Author Comment

by:joein610
ID: 35028759
I managed to install Exchange API but I get some errors:

using System;
using System.Net;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Exchange.WebServices.Data;
namespace ClassLibrary1
{
    public class Class1
    {
        ExchangeService service = new ExchangeService();
        service.UseDefaultCredentials = true;
        service.Credentials = new WebCredentials("user1@contoso.com", "password");



    }
}



3-3-2011-11-26-19-AM.png
0
 
LVL 2

Accepted Solution

by:
pchui earned 2000 total points
ID: 35029397
You forgot to put your statments in a function

using System;
using System.Net;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Exchange.WebServices.Data;
namespace ClassLibrary1
{
    public class Class1
    {
        void foo()
        {
            ExchangeService service = new ExchangeService();
            service.UseDefaultCredentials = true;
            service.Credentials = new WebCredentials("user1@contoso.com", "password");
        }
    }
}

Open in new window

0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question