Sorry for the stupid question... how do I clear an array ?
I'm using an OE email sending code that I found on this forum.
when I send to a second persone it tries also to send to the first one (everytime it just add a new email address to the array)
now I'm trying to clear the array each time:
I still want to use an array, because I want to use both option. sometimes adding more address, and sometimes only sending to one new email address.
why my code doesn't work well ?
thanks in advance, Idan
I'm using an OE email sending code that I found on this forum.
when I send to a second persone it tries also to send to the first one (everytime it just add a new email address to the array)
Code:
Private Sub RecipientAdd(ByVal lngType As Long, Optional ByVal strName As String, Optional ByVal strAddress As String) Dim r As MAPIRecip r.RecipClass = lngType If strName <> "" Then r.Name = StrConv(strName, vbFromUnicode) If strAddress <> "" Then r.Address = StrConv(strAddress, vbFromUnicode) ReDim Preserve mAr(lAr) mAr(lAr) = r lAr = lAr + 1 End Sub
Code:
Private Sub RecipientTo(ByVal lngType As Long, Optional ByVal strName As String, Optional ByVal strAddress As String) Dim r As MAPIRecip r.RecipClass = lngType If strName <> "" Then r.Name = StrConv(strName, vbFromUnicode) If strAddress <> "" Then r.Address = StrConv(strAddress, vbFromUnicode) lAr = 0 ReDim mAr(lAr) mAr(lAr) = r End Sub
why my code doesn't work well ?
thanks in advance, Idan
Comment