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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EMAILing multiple TXT files from Access

Status
Not open for further replies.

jojones

Programmer
Dec 4, 2000
104
AU
I need some help with sending multiple text files from Access. I have 6 tables that I want to send to a recipient, but I don't want to have to send them in 6 seperate emails using the SendOdject Method. I started thinking that perhaps I should Export them, which I have done, and then pick them up and email them, but I have no idea how to get the txt files from where I have dumped them.

Can anyone help? This is quite urgent.
I am using Access 97 and Outlook.

Thanks LOADS.
Jo
 
Easy stuff.

Use a twist on this code and all will be fine.

Public Sub Button1_Click

Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim datFile As Date
Dim datDate As Date
Dim intWeekday As Integer
Dim strMessageBox As String
Dim strMessageBoxTitle As String

DoCmd.OutputTo acQuery, "Query Name1, "MicrosoftExcel(*.xls)", "Attachment Path", False, ""
'Repeat this line for all your queries

'Create Outlook Session
Set objOutlook = CreateObject("Outlook.Application")

'Create message
Set objOutlookMsg = objOutlook.CreateItem(Outlook.olMailItem)

'Set attributes for message
With objOutlookMsg
Set objOutlookRecip = .Recipients.Add(Enter email address here)
objOutlookRecip.Type = Outlook.olTo
.Subject = "Subject"
.Attachments.Add "1st Attachment Path" OlByValue
'Repeat above line for all attachments
.Save .Send End With

End Sub
 
I have the same problem, but we don't use Outlook. Does Anyone know if it's possible to do this using Access 97 and Netscape rather than Outlook?

Thanks!
 
Thanks Craig - that's fantastic.

Steph - I am not sure, but perhaps you have a Netscape Reference which you need to activate in order to be able to use the Netscape Library.? I have never worked with Netscape before so that is just a guess

Jo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top