Dynamic Array

I have a multi-value field called Interviewers. I want to e-mail each interviewer in the field, but do not know how many there will be. I have it working w/ @functions, but would really like to dynamically build my list of “Sendto(interviewers(1-x))” I have read, tested, re-read, I know I am missing something simple- I thought I would count w/ ubound- but that is not working. Dim workspace As New NotesUIWorkspace

Dim uidoc As NotesUIDocument

Set uidoc = workspace.CurrentDocument

Dim doc As NotesDocument

Set doc=uidoc.Document

Dim xarray() As String	

doc.interviewers =Xarray

Dim Mylist As Integer

mylist = Ubound(doc.Interviewers)

Please point me in a direction.

Subject: Lookup “Redim Preserve” in the search on this forum and in the designer help

That should give you what you need.

Subject: Dynamic Array

Here’s a snippet that builds SendTo field values from a role in the ACL.

Let ISCount% = 0

'scan ACL for members of I.S. for SendTo

Dim acl As NotesACL

Set acl = db.ACL

Dim entry As NotesACLEntry

Let thisUser = session.Username

Let ISCount% = 0

Set entry = acl.GetFirstEntry

'check all names in ACL

Do

	If entry Is Nothing Then Exit Do

'check for I.S. people’s names

	If (entry.IsRoleEnabled("[I.S.]") = True) Then

'add I.S. person to list for send

		Redim Preserve ISPeople(ISCount%)

		Let ISPeople(ISCount%) = entry.Name

		Let ISCount% = ISCount% + 1

	End If

	Set entry = acl.GetNextEntry(entry)

Loop

Call maildoc.ReplaceItemValue(“SendTo”, ISPeople)