NameSpace object

The NameSpace object represents the root folder in Outlook. It allows you to work directly with default folders and to specify the characteristics of the current Outlook session.

Retrieving a namespace

Use the GetNameSpace method from the Application object to retrieve a namespace. You must specify “MAPI” as the namespace type.

{Retrieve a namespace.}
nameSpace = app.GetNameSpace("MAPI");

Logging on to a session

Use the Logon method to log on to a session. You can specify the profile name and the password.

{Specify the user’s profile name and password.}
nameSpace.Logon("kakers", "password");

Logging off from a session

Use the Logoff method to log off from the current session.

{Log off from a session.}

Retrieving the current user

Use the CurrentUser property to return the Recipient object for the current user.

{Retrieve the Recipient object for the current user.}
recipient = nameSpace.CurrentUser;

Documentation Feedback