Office.UserProfile interface  
有关与邮箱关联的用户的信息。 这包括其帐户类型、显示名称、电子邮件地址和时区。
属性
| account | 
	获取与邮箱关联的用户的帐户类型。  | 
| display | 
	获取用户的显示名称。  | 
| email | 
	获取用户的 SMTP 电子邮件地址。  | 
| time | 
	获取 Windows 格式的用户时区。 通常返回系统时区。 但是,在 Outlook 网页版 和新 Outlook on Windows) 中,将改为返回日历首选项中的默认时区。  | 
属性详细信息
		accountType
	 
	获取与邮箱关联的用户的帐户类型。
accountType: string;
				属性值
string
注解
最低权限级别: 读取项
适用的 Outlook 模式:Compose或读取
下表列出了可能的帐户类型。
| 值 | 说明 | 
|---|---|
| 企业 | 邮箱位于本地 Exchange 服务器上。 | 
| gmail | 邮箱与 Gmail 帐户关联。 | 
| office365 | 邮箱与 Microsoft 365 工作或学校帐户相关联。 | 
| outlookCom | 邮箱与个人 Outlook.com 帐户相关联。 | 
重要说明:
批量许可的永久Outlook 2016不支持
accountType属性。 若要解决此问题,请使用 Exchange Web Services (EWS) 调用 Exchange 本地服务器上的 ResolveNames 作。对于混合 Exchange 环境,返回的帐户类型值取决于邮箱的托管位置。 如果邮箱位于本地服务器上,则帐户类型值为 enterprise。 但是,如果它托管在 Exchange Online 上,则帐户类型值为 office365。
示例
console.log(Office.context.mailbox.userProfile.accountType);
	
		displayName
	 
	获取用户的显示名称。
displayName: string;
				属性值
string
注解
最低权限级别: 读取项
适用的 Outlook 模式:Compose或读取
示例
// Example: Allie Bellew
console.log(Office.context.mailbox.userProfile.displayName);
	
		emailAddress
	 
	获取用户的 SMTP 电子邮件地址。
emailAddress: string;
				属性值
string
注解
最低权限级别: 读取项
适用的 Outlook 模式:Compose或读取
示例
// Example: allieb@contoso.com
console.log(Office.context.mailbox.userProfile.emailAddress);
	
		timeZone
	 
	获取 Windows 格式的用户时区。
通常返回系统时区。 但是,在 Outlook 网页版 和新 Outlook on Windows) 中,将改为返回日历首选项中的默认时区。
timeZone: string;
				属性值
string
注解
最低权限级别: 读取项
适用的 Outlook 模式:Compose或读取
示例
// Example: Pacific Standard Time
console.log(Office.context.mailbox.userProfile.timeZone);