How to move an email from user mailbox to shared mailbox using apps for office mail app

How can I move an email from a users main mailbox to a shared mailbox using apps for office.  I know I can do this manually but i am creating an for owa/outlook that would be a button to move the item.  I have tried using ews but can only find the commands to move emails inside the users mailbox

for example : 

'<?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:t="http://schemas.microsoft.com/exchange/services/2006/types"' +
        '               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">' +
        '  <soap:Header>' +
        '    <t:RequestServerVersion Version="Exchange2013" />' +
        '  </soap:Header>' +
        '  <soap:Body>' +
        '    <m:MoveItem>' +
        '      <m:ToFolderId>' +
        '        <t:DistinguishedFolderId Id="junkemail" />' +
        '      </m:ToFolderId>' +
        '      <m:ItemIds>' +
        '        <t:ItemId Id="' + id + '" ' +
        '                  ChangeKey="' + changeKey + '" />' +
        '      </m:ItemIds>' +
        '    </m:MoveItem>' +
        '  </soap:Body>' +
        '</soap:Envelope>';

Can I create a xml that would would do this?  Is there a way to do it using the EWS service reference.  I do not want to use import/export to do this.  

March 10th, 2015 5:48pm

Hi ExploringDotNet,

Thanks for posting in MSDN forum.

As far as I know, the apps for Office doesn't provide the API to achieve.

However I think it maybe possible to achieve through the EWS, so I would move it to Exchange Development forum to see whether there is an solution.

Thanks for your understanding.

Regards & Fei

Free Windows Admin Tool Kit Click here and download it now
March 12th, 2015 9:22am

While doing the move is possible using EWS (eg the MoveItem operation should work as long as you have rights to both mailboxes), however the auth token that you get in an a Mail App will only allow you to access the current mailbox. So this token won't allow you to copy the Item into the shared mailbox, (You could forward it to the shared Mailbox). In Outlook you can still use an older VSTO plugin to do this with the Outlook OOM.

Cheers
Glen

 
March 15th, 2015 7:44pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics