Dart Smtp, Pop, Imap Controls
Copy Method
Specifies the name of the destination mailbox.
Optional. Specifies the message numbers to copy. The default is all messages.
Description
Copy one or more messages to another mailbox.
Syntax
Visual Basic
Public Sub Copy( _
   ByVal Destination As String, _
   Optional ByVal MsgSet As String _
) 
Parameters
Destination
Specifies the name of the destination mailbox.
MsgSet
Optional. Specifies the message numbers to copy. The default is all messages.
Remarks
If provided, MsgSet specifies one or more message numbers in the range from 1 to Count. Each number should be separated with a comma. A range of numbers may be indicated with a lower and upper number separated with a colon. For example, a message set of "1, 5:7, 12" will retrieve 5 messages: 1, 5, 6, 7, and 12.

Error Codes

This method may generate the following error code (refer to MailErrorConstants for a complete list of error codes):

Example
Private Sub Command1_Click()
	On Error GoTo OnError ' use intrinsic error handling
	Dim MsgSet As String
	' Copy All Messages from INBOX to the OldMail mailbox
	Imap1.Mailboxes("INBOX").Copy "OldMail"
	' Copy just the first and last message from INBOX to TestMbx
	MsgSet = "1," & Imap1.Mailboxes("INBOX").Count()
	Imap1.Mailboxes("INBOX").Copy "TestMbx", MsgSet
	Exit Sub
OnError: ' Any error jumps here
	Debug.Print "Error #" + CStr(Err.Number) + ": " + Err.Description
End Sub
See Also

Mailbox Object  | Mailbox Members


PowerTCP Mail for ActiveX Documentation Version 2.13
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic