Skip to content

Problem setting Appointment.StartTimeZone #234

@marcoancona

Description

@marcoancona

Hello,
I am trying to set StartTimeZone for an Appointment:

item.Subject = 'Summary';
item.Start = new ews.DateTime(start);
item.End = new ews.DateTime(end);
item.StartTimeZone = ews.TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");

This generates an error:

'The element 'CalendarItem' in namespace 'http://schemas.microsoft.com/exchange/services/2006/types\' has invalid child element 'TimeZoneDefinition' in namespace 'http://schemas.microsoft.com/exchange/services/2006/types\'. List of possible elements expected: 'MimeContent, ItemId, ParentFolderId, ItemClass, ...'

If I look at the raw request, it looks like:

<t:SetItemField>
	<t:FieldURI FieldURI="calendar:StartTimeZone"></t:FieldURI>
	<t:CalendarItem>
		<t:TimeZoneDefinition Name="(UTC-05:00) Eastern Time (US &amp; Canada)" Id="Eastern Standard Time"></t:TimeZoneDefinition>
	</t:CalendarItem>
</t:SetItemField>

where, according to the doc, it should be more like:

<t:SetItemField>
    <t:FieldURI FieldURI="calendar:StartTimeZone" />
        <t:CalendarItem>
               <t:StartTimeZone Id="Central Standard Time" />
         </t:CalendarItem>
</t:SetItemField>

Can this be the problem, or I am missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions