1

I was wondering if there was a way to for url in an outlook item and retrieve them to use them later.

I have a MessageReadCommandSurface add-in, but I only found a way to highlight them using a contextual add-in. Here's the documentation for that: https://learn.microsoft.com/en-us/office/dev/add-ins/outlook/contextual-outlook-add-ins.

Is there any event for newly opened Read command surfaces?

3
  • It is not clear from your description what exactly you would like to implement. Do you need to scan an email when a selection is changed in Outlook? Commented Apr 27, 2022 at 18:30
  • I'm trying to look for url in an email that you received. For example I click on the last email I received and all the url are logged in the console. Commented Apr 27, 2022 at 18:42
  • Contextual add-ins have rules for activating in the manifest file while the ItemChanged event allows to grab all urls and log them to the task pane. Commented Apr 27, 2022 at 20:41

1 Answer 1

1

First of all, let's realize that Outlook web add-ins work under the context of the currently selected item only in Outlook. So, each time you select an item your contextual add-in must re-evaluate conditions to activate.

You may also consider implementing a pinnable task pane where you could handle the ItemChanged event. See Implement a pinnable task pane in Outlook for more information. So, if the take pane was loaded and pinned you can just handle the ItemChanged event and process a newly selected item with relying on contextual activations.

The event-based activation can also be helpful depending on your demands. See Configure your Outlook add-in for event-based activation for more information.

If none of the provided options suits your needs I'd suggest filing a feature request at https://aka.ms/M365dev-suggestions .

Sign up to request clarification or add additional context in comments.

4 Comments

Eugene's answer is relevant and correct. Additionally, if you want to parse data of the body of an email is there a reason learn.microsoft.com/en-us/javascript/api/outlook/… doesn't work? (this can return to you the body of the email either in plaintext or HTML) There are no apis to highlight this text though.
I am trying to parse the email body without any clicking of the user or without any taskpane. I want it to be seamless. Like an onload function when it reads a new email.
With WebAdd-ins there is currently no "Launch Event" add-in for reading emails. The Contextual Add-ins you mentioned, highlight the text, but would still need user interaction. Currently only COM Add-ins would support your scenario.
As I already mentioned, consider filing a feature request at aka.ms/M365dev-suggestions .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.