Share via


AddRoot Method

AddRoot 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. The AddRoot method adds the public or mailbox folder hierarchy at the specified Uniform Resource Identifier (URI) as a root node to the TreeView control.

Applies To

ExchangeTreeViewControl Class

Syntax

Visual Basic .NET

Function AddRoot
(
	ByVal uri As String,
	ByVal rootNodeName As String,
	ByVal username As String,
	ByVal password As String,
	ByVal domain As String
) As Boolean

C#

bool AddRoot
(
	string uri,
	string rootNodeName,
	string username,
	string password,
	string domain
);

Parameters

Parameter Description
uri The URI of a public or mailbox folder on a computer running Microsoft® Exchange Server 2003.
rootNodeName The display name for the root in the TreeView control.
username The user name for an account that has permissions to view the folder.
password The password for an account that has permissions to view the folder.
domain The domain of an account that has permissions to view the folder.

Return Value

Returns True if the root was added to the TreeView control successfully.

Returns False if the root was not added to the TreeView control successfully.

Remarks

The AddRoot method will return any appropriate error information in a ControlError Event if the ErrorsReturnedNotDisplayed Property is set to True, or in a message box if it is set to False.

Examples

Visual Basic .NET

In the following example, a folder hierarchy is added as a root to the TreeView control.

exchangeTreeViewControl1.AddRoot("https://server/public/", _
				 "Public Folders", _
				 "username", _
				 "password", _
				 "domain")

C#

In the following example, a folder hierarchy is added as a root to the TreeView control.

exchangeTreeViewControl1.AddRoot("https://server/public/",
				 "Public Folders",
				 "username",
				 "password",
				 "domain");

Send us your feedback about the Microsoft Exchange Server 2003 SDK.

Build: June 2007 (2007.618.1)

© 2003-2006 Microsoft Corporation. All rights reserved. Terms of use.