我想在outlook calendar中创建事件。我做了poc .it工作正常。当它在我的项目中使用时它不起作用。我无法创建日历活动。任何帮助表示赞赏
ord = ordinal(newRatings, Ratings(unique(newRatings)));
//当我在项目中使用时
_Application olApp = (_Application)new Application();
'NameSpace mapiNS = olApp.GetNamespace("MAPI");
string profile = "";
mapiNS.Logon(profile, null, null, null);
_AppointmentItem apt = (_AppointmentItem)
olApp.CreateItem(OlItemType.olAppointmentItem);
// set some properties
apt.Subject = "Test";
apt.Body = "Testing body";
apt.Start = new DateTime(2017, 5, 20, 13, 30, 00);
apt.End = new DateTime(2017, 5, 20, 14, 30, 00);
apt.ReminderMinutesBeforeStart = 15; // One week
apt.BusyStatus = OlBusyStatus.olTentative; // Makes it appear bold in the calendar - which I like!
apt.AllDayEvent = false;
apt.Location = "Hyderabad";
bool res=apt.ForceUpdateToAllAttendees;
apt.Save();
答案 0 :(得分:0)
如果您想快速执行此操作,请查看我的Webpart到API转换器,其中包含有关如何创建Outlook事件源的说明,以便他们可以将事件保存到Outlook。它包括所有转换和支持代码(只需确保在导入时包含代码文件和全局文件夹)。
https://devnet.kentico.com/marketplace/web-parts/webpart-to-api-converter