I'm using the following code found on this site for emailing from Access to Lotus Notes. Works a treat but I've found that if the total number of characters in the email addresses number over about 270 then it doesn't work. The addresses dont transfer. Any ideas why this is?
Dim intCounter As Integer ' create loop counter
Dim strEmail As String ' string to hold email addresses
Dim strMessage As String ' string to hold email message
Dim Style As String
Dim strTitle As String
If IsNull(txtMessage) = True Then
strMessage = "Please type in your message"
Style = vbExclamation
strTitle = "No Message"
MsgBox strMessage, Style, strTitle
Me.txtMessage.SetFocus
Exit Sub
Else
strMessage = Me.txtMessage.Value
' count from 0 (root index) to total of items in listbox
For intCounter = 0 To List2.ListCount Step 1
' check to see if current listbox index is selected
If List2.Selected(intCounter) = True Then
' add the current entry to strEmail and append a semi-colon to separate names
strEmail = strEmail & List2.ItemData(intCounter) & ";"
End If
Next intCounter ' return the loop counter
End If
DoCmd.SendObject , , , strEmail, , , "Timesheet Reminder", strMessage, True
Dim intCounter As Integer ' create loop counter
Dim strEmail As String ' string to hold email addresses
Dim strMessage As String ' string to hold email message
Dim Style As String
Dim strTitle As String
If IsNull(txtMessage) = True Then
strMessage = "Please type in your message"
Style = vbExclamation
strTitle = "No Message"
MsgBox strMessage, Style, strTitle
Me.txtMessage.SetFocus
Exit Sub
Else
strMessage = Me.txtMessage.Value
' count from 0 (root index) to total of items in listbox
For intCounter = 0 To List2.ListCount Step 1
' check to see if current listbox index is selected
If List2.Selected(intCounter) = True Then
' add the current entry to strEmail and append a semi-colon to separate names
strEmail = strEmail & List2.ItemData(intCounter) & ";"
End If
Next intCounter ' return the loop counter
End If
DoCmd.SendObject , , , strEmail, , , "Timesheet Reminder", strMessage, True