Skip to content

Latest commit

 

History

History
75 lines (38 loc) · 1.6 KB

Outlook.Application.GetNamespace.md

File metadata and controls

75 lines (38 loc) · 1.6 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Application.GetNamespace method (Outlook)
vbaol11.chm717
vbaol11.chm717
Outlook.Application.GetNamespace
6175d0d9-5a61-ce45-35c0-b70895d757b3
06/08/2017
medium

Application.GetNamespace method (Outlook)

Returns a NameSpace object of the specified type.

Syntax

expression. GetNamespace( _Type_ )

expression A variable that represents an Application object.

Parameters

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.

Remarks

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

Example

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 = _ 
 
 myNamespace.GetDefaultFolder(olFolderCalendar) 
 
End Sub

See also

Application Object

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

[!includeSupport and feedback]