如何获得定期约会首次出现的ID? [英] How to get ID of the FirstOccurrence of a recurring appointment ????

查看:66
本文介绍了如何获得定期约会首次出现的ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用outlook(2007 SP1)创建了定期约会。

I created an recurring appointment using outlook(2007 SP1).

然后我尝试获得FirstOccurrence但不起作用。总是返回null。

Then I try to get the FirstOccurrence but not work. alway return null.

----------------------------------- -------------------------------------------------- -----------------

------------------------------------------------------------------------------------------------------

资料来源:

                CalendarFolder cf = CalendarFolder.bind(service,WellKnownFolderName.Calendar);

   &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP; FindItemsResults<预约> findResults = cf.findAppointments(new CalendarView(startDate,endDate));   


   &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;   PropertySet ps = new PropertySet();


   &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;   ps.add(AppointmentSchema.FirstOccurrence);

   &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;   service.loadPropertiesForItems(findResults,ps);


   &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;   for(Appointment appt:findResults.getItems())

   &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP; {&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;&NBSP;


   &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;   if(appt.getIsRecurring()){

   &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;   System.out.println(" getFirstOccurrence:" + appt.getFirstOccurrence());

   &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;  }

   &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP; &NBSP; }

                CalendarFolder cf = CalendarFolder.bind(service, WellKnownFolderName.Calendar);
                FindItemsResults<Appointment> findResults = cf.findAppointments(new CalendarView(startDate, endDate));   
                PropertySet ps = new PropertySet();
                ps.add(AppointmentSchema.FirstOccurrence);
                service.loadPropertiesForItems(findResults, ps);
                for (Appointment appt : findResults.getItems())
                {       
                    if (appt.getIsRecurring()){
                        System.out.println("getFirstOccurrence:" + appt.getFirstOccurrence());
                    }
                 }

这就是结果:

getFirstOccurrence:null

getFirstOccurrence:null

---------------------------------------------- -------------------------------------------------- -----

-----------------------------------------------------------------------------------------------------

如何获得定期约会首次出现的ID ????

How to get ID of the FirstOccurrence of a recurring appointment ????

推荐答案

我们可以参考< a href ="http://msdn.microsoft.com/en-us/library/dd633700(EXCHG.80).aspx\"target ="_ blank">
使用EWS访问定期系列中的日历项目托管API



定期系列是一系列日历项遵循重复模式并具有重复范围。重复出现的系列包括重复出现的主项目,事件项目,有时还有例外项目。下表定义了这些项
类型。有关定期系列中项目的详细信息,请参阅
EWS托管API中定期系列的概述
。本主题说明如何使用Microsoft Exchange Web服务(EWS)托管API访问定期系列中的项目。

A recurring series is a sequence of calendar items that follow a recurrence pattern and have a recurrence range. A recurring series consists of a recurring master item, occurrence items, and sometimes exception items. The following table defines these item types. For more information about the items in a recurring series, see Overview of a recurring series in the EWS Managed API. This topic explains how you can use the Microsoft Exchange Web Services (EWS) Managed API to access the items in a recurring series.

请参阅第一篇文章" ;要获得系列中的第一个或最后一个项目"。

Please refer to sample posted on the first article under the section "To get the first or last item in a series".

希望这会有所帮助!

问候,

Brij Raj Singh

Brijs博客......超越显而易见性

Brij Raj Singh
Brijs Blogging... Looking Beyond the Obvious


这篇关于如何获得定期约会首次出现的ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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