Office.UserProfile interface

有关与邮箱关联的用户的信息。 这包括其帐户类型、显示名称、电子邮件地址和时区。

注解

最低权限级别读取项

适用的 Outlook 模式:撰写或阅读

属性

accountType

获取与邮箱关联的用户的帐户类型。

注意:此成员目前仅在 Mac 版本 16.9.1212 及更高版本的 Outlook 2016 或更高版本中受支持。

displayName

获取用户的显示名称。

emailAddress

获取用户的 SMTP 电子邮件地址。

timeZone

获取 Windows 格式的用户时区。

通常返回系统时区。 但是,在Outlook 网页版中,将改为返回日历首选项中的默认时区。

属性详细信息

accountType

获取与邮箱关联的用户的帐户类型。

注意:此成员目前仅在 Mac 版本 16.9.1212 及更高版本的 Outlook 2016 或更高版本中受支持。

accountType: string;

属性值

string

注解

[ API set: Mailbox 1.6 ]

最低权限级别读取项

适用的 Outlook 模式:撰写或阅读

下表列出了可能的帐户类型。

说明
企业 邮箱位于本地 Exchange 服务器上。
Gmail 邮箱与 Gmail 帐户关联。
office365 邮箱与 Microsoft 365 工作或学校帐户相关联。
outlookCom 邮箱与个人 Outlook.com 帐户相关联。

注意:对于混合 Exchange 环境,返回的帐户类型值取决于邮箱的托管位置。 如果邮箱位于本地服务器上,则帐户类型值为 enterprise。 但是,如果它托管在 Exchange Online 上,则帐户类型值为 office365

示例

console.log(Office.context.mailbox.userProfile.accountType);

displayName

获取用户的显示名称。

displayName: string;

属性值

string

注解

最低权限级别读取项

适用的 Outlook 模式:撰写或阅读

示例

// Example: Allie Bellew
console.log(Office.context.mailbox.userProfile.displayName);

emailAddress

获取用户的 SMTP 电子邮件地址。

emailAddress: string;

属性值

string

注解

最低权限级别读取项

适用的 Outlook 模式:撰写或阅读

示例

// Example: allieb@contoso.com
console.log(Office.context.mailbox.userProfile.emailAddress);

timeZone

获取 Windows 格式的用户时区。

通常返回系统时区。 但是,在Outlook 网页版中,将改为返回日历首选项中的默认时区。

timeZone: string;

属性值

string

注解

最低权限级别读取项

适用的 Outlook 模式:撰写或阅读

示例

// Example: Pacific Standard Time
console.log(Office.context.mailbox.userProfile.timeZone);