Information to Email NOT as attachment

Look for

Microsoft DAO 3.x Library

where x is a number like 51 (i.e. 3.51, 3.6 etc.)
 
Well that got me a bit further. Now I get an error that says:
Runtime error 3265
Item not found in this collection.

When I click debug it refers me to the line:

strEmail = strEmail & rstEmail("EmailAddresses") & ";"

BTW, you were right about it beginning with Microsoft. The number was Microsoft DAO 3.6 Object Libtrary.
 
Well that got me a bit further. Now I get an error that says:
Runtime error 3265
Item not found in this collection.

When I click debug it refers me to the line:

strEmail = strEmail & rstEmail("EmailAddresses") & ";"
.
that should be "EmailAddress" singular
 
Well that about does it.
Just have to clean it up, lock it up, and make it pretty.
Thank you both for your time. I have learned some really interesting and usefull tricks from this. I was able to send emails before but always had to 'code' in the addresses of the person(s) receiving the message. Furthermore, I have always been restricted to sending attachments rather than text within the body of an email.

In the future, these new techniques will come in very handy.

Thank you again and have yourselves a great Easter Weekend.
 
Have just been asked to do the EXACT thing that has been described here, so this thread has saved me hours/days of stuffing around. THANKS HEAPS.
Works perfectly.

Just one extra thing - Can you code to send the email silently rather than bringing up the outlook Message window as I would envisage the client having to send 30 or 40 emails in one hit?

Dave
 
I had implemented the code bob had posted to imbed a report into the body of an email.

Unfortunately, I found that command

DoCmd.OutputTo acReport, "Email", acFormatTXT, strPath

appears to truncate memo fields at some random point.

To get around this, I've made the following tweaks:

1. Modify the report file to include a label where the memo field was
[InsertMemoFieldHere]
2. Update Bob's code to (italics)

Open strPath For Input As #1
Do Until EOF(1)
Line Input #1, strTemp

If strline = " [InsertMemoFieldHere]" Then
strbody = strbody & Me![MemoFieldName] & vbCrLf
Else
strbody = strbody & strline & vbCrLf
End If
Loop
Close #1

This seems to fix the problem (albeit a kludge). Anyone know of a better solution?
 

Users who are viewing this thread

Back
Top Bottom