Okay, It seems like Access stumps me atleast once a day.. Here's the scoop. I've got an e-mail database
that I'm working on. This database is simple. The e-mail addresses and other info about the people we e-mail to go into a
simple form that links to a table.
I've got a few unbound text boxes in a separate form that the user edits and puts his name, introduction message, and a
message into. I then tell the sendmail module to email the content in those unbound text boxes.. I set it up so the mail
sends them in a certain order, and viola.. the mail is sent to the folks with email addy's in the stored table.
For all original intents and purposes, the e-mail works fine. We've been pasting copying word documents and pasting them
into one of the unbound text boxes to mail documents via this database.
Here is my problem. Now management wants to be able to send a file that they can insert into an unbound object box in the
same form. They want this file to appear as an attachment in the e-mail that our clients are recieving. I don't know how to
do this. Everytime I try to set it up the same way as my unbound text boxes, I just get a little bit of garble in the e-mail
that it sends. Here's the code I'm using (keep in mind this is just the module, it links to other code behind forms and
Intro2 is the name of the unbound Ole Object box that Im putting the file into. (FYI: I've tried putting
the file in as content, as an icon, and as both linked and not linked. I'm stumped!)
My SendMail Module - modSendMail:
On Error GoTo Errhandler
Dim DB As Database
Dim RS As Recordset
Set DB = CurrentDb()
Set RS = DB.OpenRecordset("tblEmail")
Dim PersonSendTo As String
gIntro = ""
' SendMsg = gTO & Chr(13) & Chr(13) & gWrittenBy & Chr(13) & Chr(13) & SendMsg
While Not RS.EOF
gIntro = gIntro1
PersonSendTo = RS![Email]
gTO = "TO: " & UCase(RS![Contact Name])
SentMsg = gIntro & Chr(13) & gWrittenBy & Chr(13) & Chr(13) & gTO & Chr(13) & Chr(13) & SendMsg & Chr(13) & Chr(13) &
DoCmd.SendObject , , , PersonSendTo, , , SubjectLine, SentMsg, False
RS![DateSend] = Now()
gTO = ""
Set RS = Nothing
Set DB = Nothing
What do you think?
Wasting more of your valuable time...