none
Office Add-ins , How can i use "bidings" for Outlook Mailbox compose mode ? RRS feed

  • Question

  • Hello 

    How can i use "bidings" for Outlook Mailbox compose mode ? like in office word Office.context.document.bindings or how can is access the body content to use this method with javaScript?

    $('div').mouseup(function() { var text=getSelectedText(); if (text!='') alert(text);});

    or this

    window.getSelection() 

    I want to replace selected text with some text from the server(after 1 min), so if in this time, user change the selection of the text, the app still replace the text selected first time. 

    Thank you,

    Sami


    Thursday, August 6, 2015 9:00 PM

Answers

  • Hi Sami,

    >> How can i use "bidings" for Outlook Mailbox compose mode ?
    No, it is impossible. Mail app does not support bindings object at present.

    >> how can is access the body content to use this method with javaScript?
    No, you could not use it. With this method, you could operate with Html in the mail app content, but it could not interop with the message body.

    >> I want to replace selected text with some text from the server(after 1 min), so if in this time, user change the selection of the text, the app still replace the text selected first time.

    If you want to change the first selected text when the selection of the text changed, I think it is impossible. With the description of Item.setSelectedDataAsync method and Body.setSelectedDataAsync method APIs below:

    In Outlook Web App there can be a delay in inserting the text. If the selection or cursor position changes before the text is inserted, the insertion is cancelled and the method returns a CursorPositionChanged error.
    # Item.setSelectedDataAsync method (JavaScript for Office)
    https://msdn.microsoft.com/EN-US/library/office/dn903178.aspx

    If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content.
    # Body.setSelectedDataAsync method (JavaScript API for Office)
    https://msdn.microsoft.com/EN-US/library/office/dn482493.aspx

    If this is a feature you want to include in future versions of app for Office, please submit a feedback to Office Development Platform Uservoice.
    http://officespdev.uservoice.com

    Best Regards,

    Edward

     

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, August 7, 2015 6:15 AM

All replies

  • Hi Sami,

    >> How can i use "bidings" for Outlook Mailbox compose mode ?
    No, it is impossible. Mail app does not support bindings object at present.

    >> how can is access the body content to use this method with javaScript?
    No, you could not use it. With this method, you could operate with Html in the mail app content, but it could not interop with the message body.

    >> I want to replace selected text with some text from the server(after 1 min), so if in this time, user change the selection of the text, the app still replace the text selected first time.

    If you want to change the first selected text when the selection of the text changed, I think it is impossible. With the description of Item.setSelectedDataAsync method and Body.setSelectedDataAsync method APIs below:

    In Outlook Web App there can be a delay in inserting the text. If the selection or cursor position changes before the text is inserted, the insertion is cancelled and the method returns a CursorPositionChanged error.
    # Item.setSelectedDataAsync method (JavaScript for Office)
    https://msdn.microsoft.com/EN-US/library/office/dn903178.aspx

    If the cursor was never in the body of the item, or if the body of the item lost focus in the UI, the string will be inserted at the top of the body content.
    # Body.setSelectedDataAsync method (JavaScript API for Office)
    https://msdn.microsoft.com/EN-US/library/office/dn482493.aspx

    If this is a feature you want to include in future versions of app for Office, please submit a feedback to Office Development Platform Uservoice.
    http://officespdev.uservoice.com

    Best Regards,

    Edward

     

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, August 7, 2015 6:15 AM
  • Hello,

    Thansk for reply.

    So there is no other way to save and use the first selection of the text? or can I disable the cursor? and user cannot select another text in this time?

    Thank you,

    Sami

    Friday, August 7, 2015 11:19 AM
  • Hi Sami,

    >> So there is no other way to save and use the first selection of the text? or can I disable the cursor? and user cannot select another text in this time?

    Yes, there is no way to save and use the first selection if you change the selection. It is impossible to disable the cursor. The MailBox api does not support such methods.

    # Mailbox API
    https://msdn.microsoft.com/EN-US/library/office/dn705877.aspx

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, August 10, 2015 2:56 AM