Application.UserName Property
Project Developer Reference |
Returns or sets the name of the current user. Read/write String.
Syntax
expression.UserName
expression A variable that represents an Application object.
Return Value
String
Remarks
Use the UserName property to customize Microsoft Office Project 2007 options or macros for a particular user.
Suppose you have written a macro called
Visual Basic for Applications |
---|
|
that prints the report Mine.mpp when you press CTRL+R, but another user wants to use the same shortcut keys to print the report Yours.mpp. You can edit the
Visual Basic for Applications |
---|
|
macro so it checks the UserName property and then prints Mine.mpp if you are the current user or prints Yours.mpp if you are not.
By default, the UserName property equals the Author property.
Example
The following example sets preferences in Office Project 2007 according to the name of the current user.
Visual Basic for Applications |
---|
|
See Also