none
EWS throws error "The delete action is not supported for this property" RRS feed

  • Question

  • I used Office.js v1.1
    mailbox.makeEwsRequestAsync

    to delete the attachments of an email.  I get the error "The delete action is not supported for this property."  I use the following soap for the request.  Does the api support this type of operation?

    var result = '<?xml version="1.0" encoding="utf-8"?>' +
               '<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"' +
               '               xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"' +
               '               xmlns:xsd="http://www.w3.org/2001/XMLSchema"' +
               '               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"' +
               '               xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">' +
               '  <soap:Header>' +
               '    <RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" soap:mustUnderstand="0" />' +
               '  </soap:Header>' +
                   '         <soap:Body>'+
                    '          <UpdateItem MessageDisposition="SaveOnly" ConflictResolution="AutoResolve" '+
                     '       xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">'+
                  '<ItemChanges>'+
                   ' <t:ItemChange>'+
                    '  <t:ItemId Id="'+mailid + '" ChangeKey="'+ changekey + '"/>'+
                     ' <t:Updates>'+
                      '  <t:DeleteItemField>'+
                       '   <t:FieldURI FieldURI="item:Attachments"/>' +
                '        </t:DeleteItemField>'+
                 '     </t:Updates>'+
                  '  </t:ItemChange>'+
                '  </ItemChanges>'+
                '</UpdateItem>'+
                '</soap:Body>' +
                '</soap:Envelope>';
                return result;


    Wednesday, March 12, 2014 9:23 PM

Answers

  • I think a mail app can remove only the attachments that the app itself has added in the same session, to the item that is being composed. The scenario goes like this:

    1. The mail app activates when the user is composing an email.
    2. The mail app attaches a file to the email.
    3. Then later the app removes the attachment, all within the same session.

    You can use the Message.removeAttachmentAsync method. See the samples here: Adding and removing attachments to an item in a compose form in Outlook (http://msdn.microsoft.com/en-us/library/dn568061(v=office.15).aspx). See the remarks in this topic: http://msdn.microsoft.com/en-us/library/dn482512(v=office.1501401).aspx. I think one would use the DeleteAttachment operation to remove an attachment, but makeEwsRequestAsync doesn't support that operation.

    Thursday, March 13, 2014 12:15 AM
    Answerer