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.
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");
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");
Use the Logoff method to log off from the current session.
{Log off from a session.} nameSpace.Logoff();
Use the CurrentUser property to return the Recipient object for the current user.
{Retrieve the Recipient object for the current user.} recipient = nameSpace.CurrentUser;