Dynamic Arrays in LotusScript

My question follows on from the code below:

Dim sendTo(1 to 2) As String
sendTo(1) = "person_name1"
sendTo(2) = "person_name2"
Call doc.Send(True, sendTo)

How do I re-write the above code so that the "sendTo" array can be declared dynamically (e.g. 1 to n) and so enable sending to more than 1 recipient but will work if we don't know how many recipients there are.

The recipients' names will be taken from a field (e.g. distribution list) with names separated by comma (,).

Can this be done?
ashik1Asked:
Who is Participating?
 
asdapriceConnect With a Mentor Commented:
    doc.SendTo=maillist
     doc.subject=subject
     doc.DeliveryReport = 1
     doc.Form="(Memo)"
     
'Send mail message    
     Call maildoc.send(True,True)
this should would



But as better way would be just to send a link using this scipt

Sub SendOutMail(sourcedoc As NotesDocument, bodytext As String, maillist As Variant, subject As String)
     
'Create mail message    
     Dim maildoc As NotesDocument    
     Dim DBM As New NotesDatabase( "", "" )
     Call DBM.OpenMail
     
     Set maildoc=New NotesDocument (DBM)  
     Set rtitem = New NotesRichTextItem(maildoc,"Body")
     Call rtitem.AppendText( bodytext )
     Call rtitem.AddNewLine( 1 )
     Call rtitem.AppendDocLink(sourcedoc," ")
     Call maildoc.sign
     maildoc.SendTo=maillist
     maildoc.subject=subject
     maildoc.DeliveryReport = 1
     maildoc.Form="(Auto Link Memo)"
     
'Send mail message    
     Call maildoc.send(True,True)
     
End Sub

The other thing you will need to not is create the Auto Link Memo this is just a copy of the normal mail but will the
     form properties and lanch tab set to first doc link.

This makes the mail look like to doc has been mailed to the user but it is just a link.

Thus save time on routing plus save on mail servers.
0
 
rashalerCommented:
The can dynamically alter the size of an array with the ReDim (redimension) statement. For example, the following statement will expand the upper index of your sendTo array to 10:

ReDim sendTo(10)

Your code needs to determine the number of recipients required and then ReDim the array to that number.
0
 
rashalerCommented:
You can dynamically alter the size of an array with the ReDim (redimension) statement. For example, the following statement will expand the upper index of your sendTo array to 10:

ReDim sendTo(10)

Your code needs to determine the number of recipients required and then ReDim the array to that number.
0
All Courses

From novice to tech pro — start learning today.