-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Office.context.mailbox.getSelectedItemsAsync fails with 5001 error in Outlook for MacOS #5244
Comments
Here are some similar issues that might help you. Please check if they can solve your problem.
Possible solution (Extracted from existing issue, might be incorrect; please verify carefully) Solution 1:It sounds like you might have an issue with the ItemChanged event. You will need to register the event handler for the ItemChanged event when you call Office.initialize, so the add-in is notified when the item is changed. A sample for doing this can be found here. Reference:
Solution 2:To anyone that is facing something similar in Reference: |
Regarding the possible solutions, I do not think there is a problem with my ItemChanged event as it is successfully triggered every time I change which email is selected, I just get an error object instead of the mailbox item object. |
To add to this, I have just discovered that if I have 2 email accounts set up in my Mac Outlook client, and select an email from the All Accounts inbox then it works (for single emails only). UPDATE: spoke too soon, it only works in selecting the first email when the taskpane is loaded |
We are not able to repro the bug you mentioned with the snippet you provided. Can you please create a sample addin which can reproduce this bug and share the manifest and the addin in a private repository and provide access to @exextoc. It will be helpful if you can share a video of the bug too. |
I've created a test add-in but now the issue isn't presenting itself on the "live" add-in or the new test one |
I have found a decent test case |
This is the method working with console logs This is the method not working with console logs And this is the test case with open, closing and re-opening Outlook |
Your Environment
Expected behavior
The async method should return the current selected mailbox item, as it does when my Outlook Add-in is run in Outlook for windows or the web version of outlook.
Current behavior
When an email is selected from the message list my add-in returns an error object instead of the message item object
Steps to reproduce
My taskpane add-in is written with react, and uses this code to handle when the email selection is changed
The console log message on the 6th line of my code snippet is where I'm seeing the error object
Context
I am seeing this issue in a taskpane add-in I have developed that allows you to select destination folders for where you would like an email to be moved to. This add-in works perfectly on all current versions of outlook apart from Outlook for MacOS, because it does not know what the current selected email is.
Because the mailbox async item is unable to return the item object, then my add-in essentially doesn't work, without a selected email or emails, I have no item id to pass to graph to move the email.
I am semi-certain that it did work before Christmas, but I do also remember times before that that it also exhibited the same behaviour as mentioned in this issue.
Any help or advice would be greatly appreciated
The text was updated successfully, but these errors were encountered: