E
Ed Warren
I have developed my application in Access 2003, in Access 2000 format. The
code works fine on my machine (office 2003, win 2000 pro)
The application hangs when trying to output an email from access with an
'out of memory error' when executed on (some/all???) machines running
outlook express as the mail client.
What I'm trying to accomplish is: Go to a table of email addresses, combine
them into an email list
mail1;mail2;mail3;mail4
then put this list in as the bcc field in a blank email and open the email
client to make changes.
Any comments, help appreciated,
Ed Warren
----------------------------------------------------------------------------
-----------------------CODE
Function EmailNewsletterForm(strTo As String, strSubj As String, strText As
String)
'------------------------------------------------------------
' EmailNewsletterForm
'
'------------------------------------------------------------
On Error GoTo EmailNewsletterForm_Err
Dim strEmail As String
Dim rstEmail As New ADODB.Recordset
Dim strSQL As String
strSQL = "SELECT from [ENewsletterlist]"
rstEmail.Open strSQL, CurrentProject.Connection, adOpenForwardOnly,
adLockReadOnly
If Not rstEmail.EOF Then
rstEmail.MoveFirst
While Not rstEmail.EOF
strEmail = strEmail & ";" & rstEmail.Fields.Item("Email")
rstEmail.MoveNext
Wend
strEmail = Right(strEmail, Len(strEmail) - 1)
End If
Set rstEmail = Nothing
DoCmd.SendObject acSendNoObject, , , strTo, , strEmail, strSubj, strText,
True, ""
EmailNewletterForm = 1
EmailNewsletterForm_Exit:
Exit Function
Set rstEmail = Nothing
EmailNewsletterForm_Err:
MsgBox Error$
Resume EmailNewsletterForm_Exit
End Function
code works fine on my machine (office 2003, win 2000 pro)
The application hangs when trying to output an email from access with an
'out of memory error' when executed on (some/all???) machines running
outlook express as the mail client.
What I'm trying to accomplish is: Go to a table of email addresses, combine
them into an email list
mail1;mail2;mail3;mail4
then put this list in as the bcc field in a blank email and open the email
client to make changes.
Any comments, help appreciated,
Ed Warren
----------------------------------------------------------------------------
-----------------------CODE
Function EmailNewsletterForm(strTo As String, strSubj As String, strText As
String)
'------------------------------------------------------------
' EmailNewsletterForm
'
'------------------------------------------------------------
On Error GoTo EmailNewsletterForm_Err
Dim strEmail As String
Dim rstEmail As New ADODB.Recordset
Dim strSQL As String
strSQL = "SELECT from [ENewsletterlist]"
rstEmail.Open strSQL, CurrentProject.Connection, adOpenForwardOnly,
adLockReadOnly
If Not rstEmail.EOF Then
rstEmail.MoveFirst
While Not rstEmail.EOF
strEmail = strEmail & ";" & rstEmail.Fields.Item("Email")
rstEmail.MoveNext
Wend
strEmail = Right(strEmail, Len(strEmail) - 1)
End If
Set rstEmail = Nothing
DoCmd.SendObject acSendNoObject, , , strTo, , strEmail, strSubj, strText,
True, ""
EmailNewletterForm = 1
EmailNewsletterForm_Exit:
Exit Function
Set rstEmail = Nothing
EmailNewsletterForm_Err:
MsgBox Error$
Resume EmailNewsletterForm_Exit
End Function