Application.GetNamespace method (Outlook)

Returns a NameSpace object of the specified type.


expression. GetNamespace( _Type_ )

expression A variable that represents an Application object.


Name Required/Optional Data type Description
Type Required String The type of name space to return.

Return value

A NameSpace object that represents the specified namespace.


The only supported name space type is "MAPI". The GetNameSpace method is functionally equivalent to the Session property.


This Visual Basic for Applications (VBA) example uses the CurrentFolder property to change the displayed folder to the user's Calendar folder.

Sub ChangeCurrentFolder() 
 Dim myNamespace As Outlook.NameSpace 
 Set myNamespace = Application.GetNamespace("MAPI") 
 Set Application.ActiveExplorer.CurrentFolder = _ 
End Sub

See also

Application Object

How to: Obtain and Log On to an Instance of Outlook

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.