and the problams is that if I send an email, and then send another one it send to both.. since it uses an array and add the new email address to the array.
so I want to made a new sub, which will clear the old emails, and add only the new one.
I dont understand what I'm doing wrong, but now when I use the RecipientTo
its trying to send without and email address... and when I look step by step strAddress returns the email address.
(hope you'll understand my question heh...)
Expand|Select|Wrap|Line Numbers
- 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
- 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 = 1
- ReDim mAr(lAr)
- mAr(lAr) = r
- End Sub