Folder.CopyTo Method (Outlook)

Copies the current folder in its entirety to the destination folder.

Version Information

Version Added: Outlook 2007

Syntax

expression .CopyTo(DestinationFolder)

expression A variable that represents a Folder object.

Parameters

Name

Required/Optional

Data Type

Description

DestinationFolder

Required

Folder

Required Folder object that represents the destination folder.

Return Value

A Folder object that represents the new copy of the current folder.

Remarks

Setting the REG_MULTI_SZ value, DisableCrossAccountCopy, in HKCU\Software\Microsoft\Office\14.0\Outlook in the Windows registry has the side effect of disabling this method.

Example

This Visual Basic for Applications (VBA) example uses the CopyTo method to copy the default Contacts folder to the default Inbox folder.

Sub CopyFolder() 
 Dim myNameSpace As Outlook.NameSpace 
 Dim myInboxFolder As Outlook.Folder 
 Dim myContactsFolder As Outlook.Folder 
 Dim myNewFolder As Outlook.Folder 
 
 Set myNameSpace = Application.GetNamespace("MAPI") 
 Set myInboxFolder = myNameSpace.GetDefaultFolder(olFolderInbox) 
 Set myContactsFolder = myNameSpace.GetDefaultFolder(olFolderContacts) 
 Set myNewFolder = myContactsFolder.CopyTo(myInboxFolder) 
End Sub

See Also

Concepts

Folder Object Members

Folder Object