This Below codes is working good for me send PDF Report as attachment. but i want also send table as attachment.
can any one help me to expand this code.
Private Sub Command9_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim eml As String
Dim vOfficeID As String
Set db = CurrentDb
Set rs = db.OpenRecordset("SM_Email_List", dbOpenDynaset)
rs.MoveFirst
Do
vSMID = rs("SM")
DoCmd.SetWarnings False
DoCmd.RunSQL "SELECT [SM_Main_Table].* INTO [SM_Main_Output] FROM [SM_Main_Table] WHERE ((([SM_Main_Table].SM)= '" & vSMID & "'))", -1
DoCmd.SendObject acSendReport, "SM_SALES_REPORT", acFormatPDF, rs("Email Address"), rs("CC"), "", "SM Sales & Availability Report for " & rs("SM"), "Dear Sales Manager, Please find attached Sales and Availability Report. If you have any query regarding your Structure/Area Please contact your Sales coordination department", 0, False
DoCmd.SendObject acSendTable, "SM_Main_Output", acFormatXLS, rs("Email Address"), rs("CC"), "", "SM Sales & Availability Report for " & rs("SM"), "Dear Sales Manager, Please find attached Sales and Availability Report. If you have any query regarding your Structure/Area Please contact your Sales coordination department", 0, False
rs.MoveNext
Loop Until rs.EOF
rs.Close
db.Close
End Sub