App mail for office 2013, getting attachment does not work RRS feed

  • Question

  • I have the following problem:

    i tested the sample http://code.msdn.microsoft.com/office/Mail-apps-for-Office-Get-38babdc9#content and the js code does not get the attachment.

    In particular Office.context.mailbox.item.attachments.length is  equal to 0 in the following code:

     if (Office.context.mailbox.item.attachments == undefined) {
             var testButton = document.getElementById("testButton");
            testButton.onclick = "";
            showToast("Not supported", "Attachments are not supported by your Exchange server.");
        } else if (Office.context.mailbox.item.attachments.length == 0) {
            var testButton = document.getElementById("testButton");
           // testButton.onclick = "";
            showToast("No attachments", "There are no attachments on this item.");
        } else {

            // Initalize a context object for the app.
            //   Set the fields that are used on the request
            //   object to default values.
            serviceRequest = new Object();
            serviceRequest.state = 1;
            serviceRequest.identityToken = "";
            serviceRequest.attachmentToken = "";
            serviceRequest.emailAddress = "";
            serviceRequest.password = "";
            serviceRequest.ewsUrl = Office.context.mailbox.ewsUrl;
            serviceRequest.attachments = new Array();

    Any help is appreciated!!

    Best regards, 


    Wednesday, May 22, 2013 12:46 PM

All replies

  • Hi Giadev,

    Thank you for posting in the MSDN Forum.

    I'm trying to involve some senior engineers into this issue and it will take some time. Your patience will be greatly appreciated.

    Sorry for any inconvenience and have a nice day!

    Best regards,

    Quist Zhang [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, May 23, 2013 11:09 AM
  • Hi giadev, is this in Outlook or OWA? What's the version of OWA (you can check by calling Office.context.mailbox.diagnostics)? What kind of an attachment is on the message? File? Item?
    Wednesday, June 5, 2013 3:25 AM
  • Hi Andrew,

    this is in owa, the attachment is a pdf file.

    Monday, June 17, 2013 9:11 AM
  • Hi GiaDev,

    Does your app activates on ItemHasAttachment (<Rule xsi:type="ItemHasAttachment" />) rule?

    I would also suggest you to go through the article and try the basic steps for debugging this.

    Troubleshooting mail apps activation:

    Shailesh G. Rajput
    Microsoft Developer Support - Messaging & Collaboration

    Friday, July 5, 2013 4:38 PM