使用C#插入Outlook约会,asp.net [英] inserting outlook appointment using c#, asp.net

查看:602
本文介绍了使用C#插入Outlook约会,asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即时通讯寻求插入一个约会在用户的日历, 我可以在我自己的easliy插入使用Microsoft.Office.Interop.Outlook.Application(如下图), 然后添加用户作为收件人,但如果我不想增加我自己,如果我只是想添加其他人呢?可以用类似的方式这样做?

感谢

  Microsoft.Office.Interop.Outlook.Application应用= NULL;
            Microsoft.Office.Interop.Outlook.AppointmentItem聘任= N​​ULL;
            应用程序=新Microsoft.Office.Interop.Outlook.Application();

            聘任= (Microsoft.Office.Interop.Outlook.AppointmentItem)app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem);
            appt.Subject =会议;
            appt.Body =测试;
            appt.Location =房间;
            appt.Start = Convert.ToDateTime(08月08日下午5时00分零零秒);
            appt.Recipients.Add(a@b.com);
            appt.End = Convert.ToDateTime(08月08日下午6时00分00秒);
            appt.ReminderSet = TRUE;
            appt.ReminderMinutesBeforeStart = 15;
            appt.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh;
            appt.BusyStatus = Microsoft.Office.Interop.Outlook.OlBusyStatus.olBusy;
            appt.Save();
 

解决方案

您可以不(或不应该)使用Outlook API从ASP.NET应用程序。相反的Exchange Server提供了一个 Web服务SDK ,让您与Exchange Server进行交互。该文件对如何创造约会样本用户的邮箱

您可能需要代理访问用来执行ASP.NET请求的用户帐户成功地能与Exchange Server API进行交互。

EWS在Exchange 2007中首次引入对于旧版本的Exchange,您可以使用协作数据对象(CDO)的。在Exchange 2003 SDK包含有关如何创建约会文档和会议请求的。

Im looking to insert an appointment in a users calendar, I can easliy insert in my own using Microsoft.Office.Interop.Outlook.Application (below), then add the user as a recipient, but what if I dont want to add myself, if I only want to add others? Can this be done in a similar way?

thanks

            Microsoft.Office.Interop.Outlook.Application app = null; 
            Microsoft.Office.Interop.Outlook.AppointmentItem appt = null; 
            app = new Microsoft.Office.Interop.Outlook.Application(); 

            appt = (Microsoft.Office.Interop.Outlook.AppointmentItem)app.CreateItem(Microsoft.Office.Interop.Outlook.OlItemType.olAppointmentItem); 
            appt.Subject = "Meeting "; 
            appt.Body = "Test"; 
            appt.Location = "a room"; 
            appt.Start = Convert.ToDateTime("08/08/2012 05:00:00 PM"); 
            appt.Recipients.Add("a@b.com"); 
            appt.End = Convert.ToDateTime("08/08/2012 6:00:00 PM"); 
            appt.ReminderSet = true; 
            appt.ReminderMinutesBeforeStart = 15; 
            appt.Importance = Microsoft.Office.Interop.Outlook.OlImportance.olImportanceHigh; 
            appt.BusyStatus = Microsoft.Office.Interop.Outlook.OlBusyStatus.olBusy; 
            appt.Save();

解决方案

You cannot (or should not) use the Outlook API from an ASP.NET application. Instead Exchange Server provides a Web Services SDK that allows you to interact with the Exchange Server. The documentation has a sample of how to create appointments in a user's mailbox.

You may have to delegate access to the user account used to execute the ASP.NET request to succesfully be able to interact with the Exchange Server API.

EWS was first introduced in Exchange 2007. For older versions of Exchange you can use Collaboration Data Objects (CDO). The Exchange 2003 SDK contains documentation on how to create appointments and meeting requests.

这篇关于使用C#插入Outlook约会,asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆