ContactItem 方法 (Outlook)ContactItem.Copy method (Outlook)

创建对象的另一个实例。Creates another instance of an object.

语法Syntax

表达式副本expression.Copy

_表达式_一个代表ContactItem对象的变量。expression A variable that represents a ContactItem object.

示例Example

此 Visual Basic for Applications 示例创建一封电子邮件, 将主题设置为 "Speeches", 使用copy方法复制它, 然后将该副本移动到 "收件箱" 文件夹中名为 "Saved Mail" 的新创建的电子邮件文件夹中。This Visual Basic for Applications example creates an email message, sets the Subject to "Speeches", uses the Copy method to copy it, then moves the copy into a newly created email folder named "Saved Mail" within the Inbox folder.

Sub CopyItem() 
 
 Dim myNameSpace As Outlook.NameSpace 
 
 Dim myFolder As Outlook.Folder 
 
 Dim myNewFolder As Outlook.Folder 
 
 Dim myItem As Outlook.MailItem 
 
 Dim myCopiedItem As Outlook.MailItem 
 
 
 
 Set myNameSpace = Application.GetNamespace("MAPI") 
 
 Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox) 
 
 Set myNewFolder = myFolder.Folders.Add("Saved Mail", olFolderDrafts) 
 
 Set myItem = Application.CreateItem(olMailItem) 
 
 myItem.Subject = "Speeches" 
 
 Set myCopiedItem = myItem.Copy 
 
 myCopiedItem.Move myNewFolder 
 
End Sub

另请参阅See also

创建 ContactItem 对象ContactItem Object

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.