繁体   English   中英

如何在Microsoft Office JS插件中获取用户电子邮件?

[英]How can I get the user email in a Microsoft Office JS Addin?

我想获得用户电子邮件以检查其在服务中的信用。 最好不要使用任何SSO魔术,就像我们可以在Google文档插件中https://developers.google.com/apps-script/reference/base/user

userProfile对象包含成员emailAddress ,该成员返回用户的SMTP电子邮件地址的String。 此成员可从API的1.0级别获得,用法示例可能类似于...

// Example: allieb@contoso.com
Office.initialize = function (reason) {
    $(function () { 
        console.log(Office.context.mailbox.userProfile.emailAddress);
    }
}

请注意 :当前用于Word / Excel / PowerPoint的Office.js API不提供检索用户名/电子邮件地址的功能。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM