Full Version: E-mail Query through Outlook
UtterAccess Discussion Forums > Microsoft® Access > Access Q and A
optimusteoh
I have a problem here that I need to send a report to user regarding to equipment due report.

The mail contains some text and a query table.. can I do this? I'm quite new in this.. I attach my faulty code here which display an error " run-time error 2302; ms access can not save the output data to the file you selected" when i run it..

Private Sub Command1_Click()
Dim out As Object
Set out = CreateObject("Outlook.Application")
With out.CreateItem(olMailItem)
.Recipients.Add "chonyanteoh@yahoo.com"
.Subject = "Testing"
.Body = "Dear IMTE User,_eraweraw"
DoCmd.SendObject acSendQuery, "Cal Due Report", acFormatTXT, "teohcy", , , "Testing", , , False
.Display

End With

End Sub

How can I fix this? or Is there any easier way to do this? Urgent..

Any one can HELPPPP me out here... Thank you...
kuifjexx
First you have to save the query-data as a txt file, then you can mail it as an attachment

Found in the code archive
=> Access Report in Email message text
=> Sending Email and attachments from Access using Automation

Greetz from Belgium compute.gif

Luc aka Kuifjexx
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.