How to 'set' read-only calendar appointment properties (related to meetings)?

后端 未结 1 1840
旧时难觅i
旧时难觅i 2020-12-20 02:55

I\'m recreating calendar meeting events in a sychronization tool (using CreateItem), basically preserving some properties for meetings and writing them back.

相关标签:
1条回答
  • 2020-12-20 03:30

    You should be able to use MAPI Extended Properties: Appointment state is

    Named Prop Name: id: 0x8217=33303 = PidLidAppointmentStateFlags, dispidApptStateFlags
    Named Prop Guid: {00062002-0000-0000-C000-000000000046} = PSETID_Appointment
    

    So SOAP that should be something like

    <t:ExtendedProperty>
      <t:ExtendedFieldURI DistinguishedPropertySetId="Appointment" PropertyId="33303" PropertyType="Integer" />
       <t:Value>1</t:Value>
    </t:ExtendedProperty>
    

    (I use the managed API for that, and got that XML from the trace-log, hope that is something you can use)

    [Edited by the OP] This is the complete call that does the job:

    <soapenv:Envelope
      xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types"
      xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages">
    <soapenv:Header>
      <typ:RequestServerVersion Version="Exchange2007_SP1"/>
      <typ:MailboxCulture>en-US</typ:MailboxCulture>
      <typ:TimeZoneContext>
         <typ:TimeZoneDefinition Id="W. Europe Standard Time"/>
      </typ:TimeZoneContext>
    </soapenv:Header>
    <soapenv:Body>
    <mes:UpdateItem ConflictResolution="AutoResolve" SendMeetingInvitationsOrCancellations="SendOnlyToChanged">
       <mes:ItemChanges>
          <typ:ItemChange>
             <typ:ItemId <t:ItemId Id="AAMkA[snip]xAAA=" ChangeKey="Dw[snip]Mar"/>
             <typ:Updates>
                <typ:SetItemField>
                   <typ:ExtendedFieldURI DistinguishedPropertySetId="Appointment" PropertyId="33303" PropertyType="Integer"/>
                   <typ:CalendarItem>
                      <typ:ExtendedProperty>
                         <typ:ExtendedFieldURI DistinguishedPropertySetId="Appointment" PropertyId="33303" PropertyType="Integer"/>
                         <typ:Value>5</typ:Value>
                      </typ:ExtendedProperty>
                   </typ:CalendarItem>
                </typ:SetItemField>
             </typ:Updates>
          </typ:ItemChange>
       </mes:ItemChanges>
    </mes:UpdateItem>
    </soapenv:Body>
    </soapenv:Envelope>
    

    Strangely, the result says "Success", but reports a (one) conflict. I have no idea which one:

    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
       <s:Header>
          <h:ServerVersionInfo MajorVersion="15" MinorVersion="1" MajorBuildNumber="225" MinorBuildNumber="19" Version="V2_48" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
       </s:Header>
       <s:Body>
          <m:UpdateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
             <m:ResponseMessages>
                <m:UpdateItemResponseMessage ResponseClass="Success">
                   <m:ResponseCode>NoError</m:ResponseCode>
                   <m:Items>
                      <t:CalendarItem>
                         <t:ItemId Id="AAMk[snip]xAAA=" ChangeKey="DwA[snip]aMat"/>
                      </t:CalendarItem>
                   </m:Items>
                   <m:ConflictResults>
                      <t:Count>1</t:Count>
                   </m:ConflictResults>
                </m:UpdateItemResponseMessage>
             </m:ResponseMessages>
          </m:UpdateItemResponse>
       </s:Body>
    </s:Envelope>
    
    0 讨论(0)
提交回复
热议问题