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?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

asdapriceCommented:
    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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.