I would like to export the contents of a table in CSV format and email to a recepient regularly. As I understand, this can be achieved to create text files but not quite csv. I used the following code to create txt attachment. Could someone help me amend this code to attach CSV format.
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Const FILE_SPEC As String = "C:\Temp\File.txt"
Const TABLE_NAME As String = "tblPtojects"
DoCmd.SendObject acTable, "tblProjects", acFormatTXT, "Email Address", , "Design Variations", "Attached is the report showing all design variation requests that have been approved over the past three months." & _
vbCrLf _
& vbCrLf & "Cheers" & vbCrLf _
& vbCrLf & "AK", True
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
--------------------
Regards
Arshad
Private Sub Command0_Click()
On Error GoTo Err_Command0_Click
Const FILE_SPEC As String = "C:\Temp\File.txt"
Const TABLE_NAME As String = "tblPtojects"
DoCmd.SendObject acTable, "tblProjects", acFormatTXT, "Email Address", , "Design Variations", "Attached is the report showing all design variation requests that have been approved over the past three months." & _
vbCrLf _
& vbCrLf & "Cheers" & vbCrLf _
& vbCrLf & "AK", True
Exit_Command0_Click:
Exit Sub
Err_Command0_Click:
MsgBox Err.Description
Resume Exit_Command0_Click
End Sub
--------------------
Regards
Arshad