Create appointment with custom properties in EWS

前端 未结 1 549
悲&欢浪女
悲&欢浪女 2021-01-28 16:27

I try to add a custom property to created appointments like this:

var newEvent = new Appointment(service)
        {
            Start = start,
            End =          


        
相关标签:
1条回答
  • 2021-01-28 17:05

    You need to first Create a property set, add the extended property you want to load to that property set. Then tell EWS you want that property returned when you execute the FindAppointment method see https://msdn.microsoft.com/en-us/library/office/dd633697(v=exchg.80).aspx eg in your example

            PropertySet YourProperyset = new PropertySet(BasePropertySet.FirstClassProperties);
            var extendendProperty = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Address, "organizer",MapiPropertyType.String);
            YourProperyset.Add(extendendProperty);
            var folderId = new FolderId(WellKnownFolderName.Calendar, new Mailbox(userName));
            var calendar = CalendarFolder.Bind(service, folderId);
            var calendarView = new CalendarView(start, stop);
            calendarView.PropertySet = YourProperyset;
            return calendar.FindAppointments(calendarView).ToList();
    
    0 讨论(0)
提交回复
热议问题