| | |
|
|
|
Concatenate string limit |
| message from Curt on 20 May 2004 |
I created a form which allows the user to select the
criteria/group of people they wish to send an email to.
After the selection a macro is used to concatenate the
emails in the To section of Outlook. This all works fine,
but for some reason when it goes through this process the
To: section only allows 255 charaters. Is there a rule
about a string having a limit of 255? I used a
concatenate function I got from some one a couple years.
Thanks for any suggestions
Function Concatenate(pstrSQL As String, _
Optional pstrDelim As String = "; ") As String
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim strConcat As String 'build return string
Set db = CurrentDb
Set rst = db.OpenRecordset(pstrSQL)
With rst
If Not .EOF Then
.MoveFirst
Do While Not .EOF
strConcat = strConcat & .Fields(0) &
pstrDelim
.MoveNext
Loop
End If
.Close
End With
Set rst = Nothing
Set db = Nothing
If Len(strConcat) > 0 Then
strConcat = Left(strConcat, Len(strConcat) - Len
(pstrDelim))
End If
Concatenate = strConcat
End Function
|
| Cheryl Fischer replied to Curt on 20 May 2004 |
You have not indicated how you are creating your emails; however, if you are
using Outlook Automation, the following code sample will allow you to read
Dim oApp As Outlook.Application
Dim objNewMail As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim rs As DAO.Recordset
Set rs = Me.RecordsetClone
Set oApp = New Outlook.Application
Set objNewMail = oApp.CreateItem(olMailItem)
With objNewMail
rs.MoveFirst
Do While Not rs.EOF
If Len(Trim(rs!Email)) > 0 Then
Set objOutlookRecip = .Recipients.Add(rs!Email)
objOutlookRecip.Type = olTo
End If
rs.MoveNext
Loop
.Subject = "Test subject"
.Body = "Your text message here."
.Save
.Send
End With
|
| Curt replied to Cheryl Fischer on 20 May 2004 |
Thanks I will give it a try.
I was using a macro SendObject to create the email.
however, if you are
allow you to read
source and add it to the
Email)
fine,
the
|
|
Archived message: Concatenate string limit (Microsoft Access)