I have an editable field (INaddcopy) in a form with type “Names”. Next to it is a button with this formula:
FIELD INaddCopy := @Name([CN];@PickList([Name]:[Shared]));“”
So, the user can select 1 or more names out of the Company’s Name & Address book.
Then, there is a “Submit” button in which an email is sent to the persons in the field INaddcopy:
This script is used:
Dim maildoc As NotesDocument
Dim rtitem As NotesRichTextItem
Dim strPersonName As String
Dim nn As NotesName
Dim recip(5) As String
Set maildoc=New NotesDocument(db)
maildoc.SendTo=doc.INsupv(0)
maildoc.copyTo=doc.INdivmgr(0)
recip(0) = doc.INaddCopy(0)
recip(1) = doc.INaddCopy(1)
maildoc.BlindCopyto = recip
maildoc.Subject = "First notification Injury - " + doc.INNum(0)
Set nn = ss.CreateName(doc.INsupv(0))
strPersonName = nn.Common
Set rtitem = New NotesRichTextItem( mailDoc, “Body” )
'Call rtitem.AppendText("Dear " + doc.INsupv(0) + “,” )
… ETCETERA …
maildoc.Send(0)
The problem is probably in the instruction:
recip(0) = doc.INaddCopy(0)
recip(1) = doc.INaddCopy(1)
maildoc.BlindCopyto = recip
… where I’m getting a “subscript out of range” error
What am I doing wrong?