命名空间 CurrentUser 属性 (Outlook)NameSpace.CurrentUser property (Outlook)

将当前登录的用户的显示名称作为**收件人** 对象返回。Returns the display name of the currently logged-on user as a Recipient object. 此为只读属性。Read-only.

语法Syntax

expressionexpression. CurrentUser

_表达式_一个代表NameSpace对象的变量。expression A variable that represents a NameSpace object.

示例Example

此 Visual Basic for Applications (VBA) 示例使用CurrentUser属性获取当前登录用户的名称, 然后显示包含该名称的消息框。This Visual Basic for Applications (VBA) example uses the CurrentUser property to obtain the name of the currently logged-on user and then displays a message box containing the name.

Sub DisplayCurrentUser() 
 
 Dim myNamespace As Outlook.NameSpace 
 
 
 
 Set myNameSpace = Application.GetNameSpace("MAPI") 
 
 MsgBox myNameSpace.CurrentUser 
 
End Sub

另请参阅See also

命名空间对象NameSpace Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.