locked
Contextual Outlook add-in RRS feed

  • Question

  • I am able to identify a text string, which I have defined in the ItemHasRegularExpressionMatch tag in the manifest file. So far so good.  But I need to catch the event when this underlined text is clicked, get the text clicked and perform an action on the text. Is such an event available? I am aware of the getRegExMatches function, but need an event to fire when the text is clicked.

    Thank you

    Torben

    Tuesday, October 11, 2016 6:08 AM

Answers

  • Hello,

    Underlined text in the body of a message appears because of the match corresponds to expression in your add-in manifest file. When user click on the text your add-in will be invoked and the HTML page specified as the start page for read form will be presented. Time when user click on the text is exactly event of invocation of your add-in. Inside the "Office.initialize" function of your start .js file loaded by the HTML you may do any calls to Office.js API to retrieve matching text or do some action on this text. Please refer to Contextual Outlook add-ins documentation. You may also read the Making your Outlook Add-in contextual article.

     Hope this helps,


    Slava Ivanov

    • Proposed as answer by David_JunFeng Thursday, October 20, 2016 1:26 AM
    • Marked as answer by tobang Thursday, October 20, 2016 6:02 AM
    Tuesday, October 11, 2016 6:12 PM

All replies

  • Hello Torben,

    The Outlook extensibility model doesn't provide anything for that. You may consider using a timer for checking the selection.


    [custom.development]

    Tuesday, October 11, 2016 1:36 PM
  • Hello,

    Underlined text in the body of a message appears because of the match corresponds to expression in your add-in manifest file. When user click on the text your add-in will be invoked and the HTML page specified as the start page for read form will be presented. Time when user click on the text is exactly event of invocation of your add-in. Inside the "Office.initialize" function of your start .js file loaded by the HTML you may do any calls to Office.js API to retrieve matching text or do some action on this text. Please refer to Contextual Outlook add-ins documentation. You may also read the Making your Outlook Add-in contextual article.

     Hope this helps,


    Slava Ivanov

    • Proposed as answer by David_JunFeng Thursday, October 20, 2016 1:26 AM
    • Marked as answer by tobang Thursday, October 20, 2016 6:02 AM
    Tuesday, October 11, 2016 6:12 PM
  • Hi tobang,

    According to your description, I have searched over Javascript API for Office, but there is no features that support the event when this underlined text is clicked. So I suggest that you could folllow Slava Ivanov's sugggestion to adjust your Outlook add-in project.

    If this is a feature you want to include in the feature version, I suggest you submit a feedback from the link below:

    https://officespdev.uservoice.com/

    Thanks for your understanding.
    Wednesday, October 12, 2016 6:27 AM