how to make an excel file and export it to mail (1 Viewer)

mana

Registered User.
Local time
Yesterday, 17:56
Joined
Nov 4, 2014
Messages
265
Hello

i want to make an excel file from a query and then export it to mail. can you guide me please how to do this?
i want to make an excel and then send it as an attachhment.
also i want to insert the mail address to manually
because each time it is sent to a different person.
thank you
 

Ranman256

Well-known member
Local time
Yesterday, 20:56
Joined
Apr 9, 2015
Messages
4,337
DoCmd.SendObject acSendQuery, "qsQuery", acFormatXLS, "name@aol.com", , , "Subject", "message"

if you build a listbox of email names , then scan the list , the query can read the list and send only that person's data.

Code:
  'scan items in listbox
For i = 0 To lstClients.ListCount - 1
   vTo = lstClients.ItemData(i)
   lstClients = vTo
        
   DoCmd.SendObject acSendQuery, "qsQuery", acFormatXLS, vTO, , , "Subject", "message"
next
 

mana

Registered User.
Local time
Yesterday, 17:56
Joined
Nov 4, 2014
Messages
265
hello
thank you for your help
but i want to fill out the email address manually
and without message
is it possible in this way as well?
 

Users who are viewing this thread

Top Bottom