Using Predetermined List to E-Mail Document

Currently I have a workflow document that is automatically sending the initializer an email when the last signature is applied. I use LotusScript sendTo method pointing to a field on the doc that has the initializers name in it.

Now I also need to send this notification to several other people. I have them identified in a field on a control doc. Hao do I add the list of people to the sendTo method?

Subject: Using Predetermined List to E-Mail Document

The SendTo field is a multi-value field.In order to get the mail sent to multiple people, you must create an array with the recipients and set the SendTo field to the array.

Example:

Dim strNameArray() As String

Dim ix As Integer

Dim item As NotesItem

'-- Get a ref to the control doc.

Set docControl = …

'-- Get the item containing names.

Set item = docControl.GetFirstItem(“FieldWithNames”)

'-- Create an array with the names.

ix = 0

ForAll v in item.Values

Redim Preserve strNameArray(ix)

strNameArray(ix) = v

ix = ix + 1

End ForAll

'-- Populate the SendTo field with the array.

Call docMemo.ReplaceItemValue(“SendTo”, strNameArray)

Subject: Using Predetermined List to E-Mail Document

Assuming that OtherPeopleField is a multi-value field in your control doc containing the other recipient names, you can do…

docMail.Form = “Memo”

docMail.ReplaceItemValue “SendTo”, initializer

docMail.ReplaceItemValue “CopyTo”, controlDoc.OtherPeopleField

docMail.Send