Lotusscript - Sending email to multi value field

Hello,

I apologize in advance but it has been some time since I have coded and can’t seem to figure out the simple task of having my code below allow me to send an update email to a multi valued text field. That multi valued text field is being populated via a submit button from another multi valued text field which contains multiple people seperated by colon’s.

I believe I need to make it an array but I can’t seem to do it and have it work and have begun to go in circles with googling.

Thank you!!!

Below is my code (my issue is when trying to send to Doc.OtherManagers):

Option Public

Sub Initialize

Dim Session As New NotesSession

Dim DB As NotesDatabase

Dim MailDoc As NotesDocument

Dim Doc As NotesDocument

Dim View As NotesView

Dim Body As NotesRichTextItem





Set DB = Session.CurrentDatabase

Set View = DB.GetView("(VacationReminderEmail)")

Set Doc = View.GetFirstDocument



			

	If Doc Is Nothing Then

		Exit Sub

		

	Else

		Do Until Doc Is Nothing

			Set MailDoc = DB.Createdocument() 

			MailDoc.SendTo = Doc.Manager(0)

			MailDoc.CopyTo = Doc.OtherManagers(0)

			

			MailDoc.Subject = Doc.TeamMember(0) & " is on vacation beginning on " & Doc.StartDate(0) & " and returning on " & Doc.EndDate(0)

			Set Body = New NotesRichTextItem( MailDoc, "Body" )



			Set Doc=View.GetNextDocument( Doc )

			Call MailDoc.Send(False)			

		Loop

		

	End If		

End Sub

Subject: Lotusscript - Sending email to multi value field

Try:

MailDoc.SendTo = Doc.GetItemValue(“Manager”)

GetItemValue returns an array - so I think that will do it…

Subject: RE: Lotusscript - Sending email to multi value field

Sorry for the delay in my response but thank you very very much. That worked perfectly.

Subject: RE: Lotusscript - Sending email to multi value field

Thanks for the update!

It’s been a frustrating day, so it’s good to know that SOMETHING worked out right!

:wink: