Results 1 to 2 of 2
2007-09-22, 16:00 #1
- Join Date
- Jul 2001
- Thanked 0 Times in 0 Posts
send a query to email (Access 2000)
Can you help me automate the process of sending a query in cvs format directly to an email recipient ? I am creating a query with cvs format and i export it it in the MyDocument directory
I have the following code in my form, which works :
DoCmd.TransferText acExportDelim, "qryDocsExportSpecification", "QryDocs", "QryDocs.csv"
My question is, is it possible to send the query QryDocs in txt format, directly through the email , directly and together with the TransferText command ?
2007-09-22, 16:18 #2
- Join Date
- Mar 2002
- Thanked 30 Times in 30 Posts
Re: send a query to email (Access 2000)
If it would be OK to send the query as a .txt file instead of as a .csv file, you don't need to use TransferText. You can send the query directly using DoCmd.SendObject:
DoCmd.SendObject acSendQuery, "QryDocs",acFormatTXT,"firstname.lastname@example.org",,,"T est e-mail", "This is a test e-mail.", True
It is also possible to send the query as an Excel workbook, RTF file (compatible with Word) or HTML file.
If you need to send the .csv file, you'd need to use Automation to control Outlook from Access. If you search this forum for outlook.application attachment you'll find examples.