Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    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 ?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 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,"",,,"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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts