在Outlook中将事件添加到自定义日历

时间:2013-11-05 15:11:24

标签: events calendar hotmail

如何使用Live SDK for .NET将enevt添加到Outlook中的自定义日历?在文档中,您只将事件添加到默认日历,而不是自定义。

    private async void btnCreateEvent_Click(object sender, RoutedEventArgs e)
    {
    try
    {
        var calEvent = new Dictionary<string, object>();
        calEvent.Add("name", "Family Dinner");
        calEvent.Add("description", "Dinner with Cynthia's family");
        calEvent.Add("start_time", "2012-04-07T01:30:00-08:00");
        calEvent.Add("end_time", "2012-04-07T03:00:00-08:00");
        calEvent.Add("location", "Coho Vineyard and Winery, 123 Main St., Redmond WA 19532");
        calEvent.Add("is_all_day_event", false);
        calEvent.Add("availability", "busy");
        calEvent.Add("visibility", "public");
        LiveConnectClient liveClient = new LiveConnectClient(this.session);
        LiveOperationResult operationResult = await liveClient.PostAsync("me/events", calEvent);
        dynamic result = operationResult.Result;
        this.infoTextBlock.Text = string.Join(" ", "Created event:", result.name, "ID:", result.id);
    }
    catch (LiveConnectException exception)
    {
        this.infoTextBlock.Text = "Error creating event: " + exception.Message;
    }
}

我尝试用日历ID替换路径“me / events”,但它不起作用。

1 个答案:

答案 0 :(得分:0)

你说:

  

我试图替换路径&#34; me / events&#34;按日历ID,但它不是   工作

你离我一厘米的距离!!

您应该已将"me/events"替换为"CALENDAR_ID/events"

在我问here in SO之后我才提出这个问题,我在阅读了MSFT论坛后回答了这个问题