I have a email that is created when the customer service rep enters a call and then clicks a button "Submit Request to Team". They enter the team name in the S_Team field and then can enter more then one value in the Copy to field CopyTo. I have been having the issue that when they put more then one name in the copy to field that it will only send to the first person listed. I have found the answer that a dynamic array needs to be defined for the copyto field but I have no idea how to write it. I have tried for the past two days to figure this out and I keep failing.
What I thought I would need to add is to delcare "copylist" as a variant, then set copylist to the doc.CopyTo and then call the copylist in the mailsend function. That is not working. I am lost. Arrays are not my strength and I need some help.
Sub Click(Source As Button)
Dim s As NotesSession
Dim db As NotesDatabase
Dim ws As NotesUIWorkspace
Dim uidoc As NotesUIDocument
Dim doc As NotesDocument
Dim edoc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim user As String
Set s = New NotesSession
Set db = s.CurrentDatabase
Set ws = New NotesUIWorkspace
Set uidoc = ws.CurrentDocument
Set edoc = New NotesDocument(db)
Set doc = uidoc.Document
Set rtitem = New NotesRichTextItem(edoc, "Body")
doc.AllowClose = "1"
doc.SaveOptions = "1"
doc.Status = "Pending"
doc.Action= "Submitted Request"
doc.ActionDate = Now
doc.Status_Final="Closed - Forwarded"
Set item = doc.GetFirstItem( "Person" )
Call item.AppendToTextList( doc.SubmittedBy )
Set item = doc.GetFirstItem( "Action" )
Call item.AppendToTextList( "Forwarded" )
Set item = doc.GetFirstItem( "ActionDate" )
Call item.AppendToTextList (Date$ + " " + Time$)
Dim T As String
T=Inputbox("Please enter any email comments.")
edoc.SendTo = doc.Email_Address(0)
edoc.CopyTo = doc.CopyTo(0)
edoc.Subject = "Please review following Phone Request " + doc.Policy(0)
Call rtitem.AppendText("Please Review")
Call rtitem.AppendText("Email Comments: "+T)
Call rtitem.AppendText("Link to Document ==> ")
Call rtitem.AppendDocLink(doc, "", "")
Messagebox "Your phone call has been sent to "+doc.S_Team(0), 64, "Sent"
Dim workspace As New NotesUIWorkspace
Dim parent As notesUiDocument
Set parent = ws.currentDocument
Call workspace.ComposeDocument( "", "", "Call" )