GetNameSpace Method

Microsoft Outlook Visual Basic

GetNameSpace Method

       

Returns a NameSpace object of the specified type.

expression.GetNameSpace(Type)

expression   Required. An expression that returns an Application object.

Type   Required String. The type of name space to return.

Remarks

The only supported name space type is "MAPI".

Example

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")