Multivalue fields

I have mutlivalue fields with multiple names and it only send to one person not to all. Dim session As New NotesSession

Dim db As NotesDatabase

Dim ws As New notesuiworkspace

Dim doc As NotesDocument, doc1 As notesdocument

Dim mailDoc As NotesDocument

Dim rtitem As NotesRichTextItem     

Dim uidoc As notesuidocument



Set uidoc=ws.currentdocument

Set db = session.Currentdatabase

Set doc = uidoc.Document	

doc.SaveOptions="1"

doc.Submitted=Today

Set mailDoc = New NotesDocument( db )

Set rtitem = New NotesRichTextItem( mailDoc, "Body" )

mailDoc.Form = "Memo"

mailDoc.Subject = "Test"

Call rtitem.appendtext ("TEst.")

Call rtitem.AddNewLine(2)          

Call rtitem.AppendText("Double-click on the below doclink, to open and add to  your workspace.===> " )

Call rtitem.AppendDocLink(doc, maildoc.Subject(0))

Dim profileMNF As NotesItem

Dim profdoc As NotesDocument

Set profdoc = db.GetProfileDocument("ProfileList")	

Set profileMNF = profdoc.GetFirstItem("MgNetwork")

mailDoc.SendTo =profileMNF.values(0)

Call mailDoc.send( True,True)

Call uidoc.Save

Call uidoc.close

please advise.

amp

Subject: multivalue fields

Your code is explicitly setting the value of the sendTo field to the first name in the field. Try changing:

mailDoc.SendTo =profileMNF.values(0)

to:

call mailDoc.replaceItemValue( “sendTo”, profileMNF.values )

Frunobulax

Subject: RE: multivalue fields

thanks it worked.