This Visual Basic for Applications example uses GetNameSpace to obtain the MAPI NameSpace object.
Set myOlApp = CreateObject ("Outlook.Application")
Set myNameSpace = myOlApp.GetNameSpace("MAPI")
If you use VBScript, you do not create the Application object. This example shows how to perform the same task using VBScript.
Set myNameSpace = Application.GetNameSpace("MAPI")