Export (0) Print
Expand All

Folder.CopyTo Method (Outlook)

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

Version Added: Outlook 2007

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.

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.

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

Concepts

Other resources

Show:
© 2014 Microsoft