I would like to understand if there is any API which can help us find the Office 365 user account information from my Excel add-in javascript code. Eg- Let's assume a user with Office email account abc@xyz.com launches Excel, downloads my add-in from Office store and uses it. I want to capture this user info from my app for the various users who downloaded/using my app. Is there an API in apps for office to achieve this?
相关问题
- How to name and reference an Excel range using off
- Setting width of Office add-in task pane
- Office Dialog API send message to child dialog
- Office.js content add-in insertion behavior
- Excel Add In - Where does console.log output it
相关文章
- Outlook WebAddin is detected as contextual addin i
- Add excel custom functions to an existing excel ad
- Pop-up blocked error when opening url from outlook
- How can I retrieve the full MIME message from an M
- Office API call to getUserIdentityTokenAsync() ret
- cors issue with Outlook Add-In
- How to check an Outlook custom property is availab
- No event is fired when closing a dialog via ESC
No, there is not currently an API in Office add-ins in Word/Excel/PowerPoint that exposes the user information for the person logged on to the Office clients.
In Outlook add-ins you can retrieve this information.
See the userProfile object documentation for more information.
To add to Doug's response: while it doesn't expose the user's email address, you can get a unique identifier for the user from the entitlement token, provided your app is in the Office Store. See https://msdn.microsoft.com/en-us/library/office/jj164035.aspx for more info.
The UserId property of the entitlement token response (https://msdn.microsoft.com/en-us/library/office/verificationsvc.verifyentitlementtokenresponse_members.aspx) is the purchaser ID. Per the documentation above, "This is an encrypted value of the Microsoft account used by the person who purchased the app".
Hope this helps,
~ Michael Zlatkovsky, developer on Office Extensibility team, MSFT