Platform SDK: CDO 1.2.1

AddMultiple Method (Recipients Collection)

The AddMultiple method creates zero or more new Recipient objects in the Recipients collection.

Syntax

objRecipColl.AddMultiple(names [, type] )

objRecipColl
Required. The Recipients collection object.
names
Required. String. A list of zero or more resolvable recipient strings delimited by semicolons. Each resolvable string can be a messaging user’s display name or a messaging address with or without the address type. A messaging address without address type must be an SMTP (Simple Mail Transfer Protocol) address usable on the Internet.
type
Optional. Long. The recipient type; the initial value for the Type property that is to apply to all the new recipients. The following values are valid:
Recipient type Value Description
CdoTo 1 The recipients are on the To line (default).
CdoCc 2 The recipients are on the Cc line.
CdoBcc 3 The recipients are on the Bcc line.

Remarks

The AddMultiple method is useful when responding to standard e-mail forms that invite the user to enter a series of recipients in a connected list, such as the To and Cc lines for a Microsoft® Exchange Client message.

The AddMultiple method does not resolve the new recipients. You must call either each recipient’s Resolve method or the Recipients collection’s Resolve method following the AddMultiple call.

Example

This code fragment illustrates the different possibilities of resolvable recipient strings:

Dim name1, name2, name3, toStr As String 
name1 = "John Doe" ' display name 
name2 = "jimdoe@microsoft.com" ' SMTP address without address type 
name3 = "Jane Doe[SMTP:janedoe@microsoft.com]" ' full messaging address 
toStr = name1 & ";" & name2 & ";" & name3 
objRecipients.AddMultiple (toStr, CdoTo) 
objRecipients.Resolve()