Share via


GetNameSpace Method

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.

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