1
votes

I'm creating an Outlook Add-in that will take the recipients and check to see if they exists in our database.

When the user clicks on a mailto link on a page it will pop up the Outlook compose window and the recipient will be populated as such.

to-text-mail

Running the Add-in will lead to a nothing being returned from the Office.context.mailbox.item.to.getAsync function.

    Office.initialize = function () {
        $(document).ready(function () {
            Office.context.mailbox.item.to.getAsync(getRecipientFromDB);
        });
    };

However, the recipient will now look like this:

to-text-mail-2

Retrying the Add-in will now work because the Office.context.mailbox.item.to.getAsync function will actually return a result.

My Outlook version is 16.0.11029.20045.

Has anyone ran into this issue before?

1
Just want to clarify this - getRecipientFromDB is a callback function, and you're validating the result right?Mavi Domates
It would be useful to know your Outlook version. There's a post here: stackoverflow.com/questions/49537433/… which talks about functionality being fixed in 16.0.8309.1000Mavi Domates
@MaviDomates Yup, getRecipientFromDB will validate the result before doing anything. I have also updated the question with my Outlook version.rgpieters

1 Answers

0
votes

to.getAsync will return every resolved recipient in the "to" field. In the first screenshot, [email protected] is not resolved, so to.getAsync will not return anything. If you open the compose window, wait until recipients resolve, and then run the add-in, to.getAsync will return a result.