Emails From Query to outlook folder

TallMan

Registered User.
Local time
Today, 00:51
Joined
Dec 5, 2008
Messages
239
Hello,

Does anyone know which command/function you would use to automatically store emails generated from a query? I need to have all emails sent saved for future audits.

Please let me know if you need more information.

Thanks!
 
Hello,

Does anyone know which command/function you would use to automatically store emails generated from a query? I need to have all emails sent saved for future audits.

Please let me know if you need more information.

Thanks!

It would help to see your code. Depending on what you are doing may determine the best method.

1) Process then store:

Basically you would send the email then use the sale selection criteria to save the data.

or

2) Store then Process:

Store the data for emails, then send the emails that have not been sent.


I tend to use #2.
 
Last edited:
Hey Guys,

I am still trying to find a way to have emails that are sent automatically save to a sub folder in outlook. I have pasted some of my code. I have searched the internet but I am not coming up with anything. Basically after I hit the "Pending Contracts" button an email is generated with an excel spreadsheet attached. After this is sent out to the individual I need it to be also be saved to a folder in Outlook. (For auditing purposes. Let me know if I need to display more information.

Thanks





sqlallemails = "SELECT * FROM Grouped_Emails;"
Set rs3 = db.OpenRecordset(sqlallemails)
While Not rs3.EOF
sqlemail = "SELECT Pending_Tbl.Account_Number, Pending_Tbl.Account_Name, Pending_Tbl.Primary_FA_num, Pending_Tbl.Branch, Pending_Tbl.New_Subcategory_ID, Pending_Tbl.DT_Code_Changed, Pending_Tbl.DT_Contract_Received "
sqlemail = sqlemail & "FROM Pending_Tbl "
sqlemail = sqlemail & "WHERE Pending_Tbl.Email='" & rs3.Fields(0) & "';"
qry.SQL = sqlemail
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "Pending_Accounts", "C:\Pending_Contracts.xls", True
Set email = oLook.CreateItem(0)
With email
.To = rs3.Fields(0)
.Subject = "ATTENTION: Pending AMS Contract(s)"
.Attachments.Add "C:\Pending_Contracts.xls"
.HTMLBody = "Text text text<br><br>text text text"
'.Display
.Send
'.Move ("mydestfolder")
End With
rs3.MoveNext
Wend
End Sub
 

Users who are viewing this thread

Back
Top Bottom