Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to create email and attach file that is stored in database field

Status
Not open for further replies.

bobetko

Programmer
Jan 14, 2003
155
0
0
US
I have access form bounded to table (SQL 2000)

On the Form I need to have button to create email and to attach file (word or excel document) stored in the table field.

So, how to attach to email document that is stored in table field?

Also, does anybody know how to open this document through access?

Thanks.
 
Use the Send Object:

DoCmd.SendObject acSendTable, "Employees", acFormatXLS, _
"Nancy Davolio; Andrew Fuller", "Joan Weber", , _
"Current Spreadsheet of Employees", , False
 
Just a Note:
DoCmd.SendObject
Only works “automatically” IF you don't have Outlook 2002 or above. You can thank viruses for the new features added to it. It worked great in Outlook ’97 and Outlook 2000 if you did not add Service pack 2 for Office 2000. Viruses took advantage of the Outlooks ability to send things in the background, which is what DoCmd.SendObject does when the last parameter is set to False.
So Microsoft added a fix to stop viruses from taking advantage of its software in Service pack 2 and built it in all subsequent releases.

You will get a message saying “Something” is trying to send an email. Do you want to allow it? It will count down a few seconds. It will send it if you click “YES” but you have to wait. If you don’t answer yes it will not send it, the default is no.

We used to use it DoCmd.SendObject it all the time but now we can't.

DougP, MCP, A+
 
but, this doesn't do what I want.
DoCmd.SendObject is sending the whole table attached to email. What about my document stored into table?

I need to attach document that is stored in the table field.

Imagine I am positioned on record 5. Table contains field "docfile" which contains word document previously uploaded through internet form. How to create email and attach this file (from field docfile) to this email.

Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top