OutputFormat - acFormatHTML ,acFormatRTF ,acFormatSNP,acFormatTXT ,acFormatXLS, acFormatXLSX , acFormatPDF , etc. Output file - Complete path of output file eg. C:\abc.xls or d:\abc.pdf Keep it blank if you want to save at run time. AutoStart Optional Variant Templatefile - The full name, including the path, of the file to use as a template for an HTML file Encoding- Optional Variant
' EXAMPLE 1 EXPORT form TO xls FORMAT Sub send_form_to_xls_using_docmd_outputto() DoCmd.OutputTo acOutputForm, "sales_detail", acFormatXLS, , True End Sub
' EXAMPLE 2 EXPORT form TO rtf FORMAT Sub send_form_to_rtf_using_docmd_outputto() DoCmd.OutputTo acOutputForm, "sales_detail", acFormatRTF, , True End Sub
' EXAMPLE 3 EXPORT TABLE TO RTF FORMAT Sub send_table_to_RTF_using_docmd_outputto() DoCmd.OutputTo acOutputTable, "sales_detail", acFormatRTF, , True End Sub
' EXAMPLE 4 EXPORT TABLE TO EXCEL FORMAT Sub send_table_to_excel_using_docmd_outputto() DoCmd.OutputTo acOutputTable, "sales_detail", acFormatXLS, , True End Sub
' EXAMPLE 5 EXPORT TABLE TO EXCEL FORMAT Sub send_table_to_PDF_using_docmd_outputto() DoCmd.OutputTo acOutputTable, "sales_detail", acFormatPDF, , True End Sub
'EXAMPLE 6 Sub export_report_to_rtf() Dim rptname As String rptname = "rep_name_a" 'in rtf format DoCmd.OutputTo acOutputReport, rptname, acFormatRTF, , True End Sub
' EXAMPLE 7 Sub export_report_to_pdf() Dim rptname As String rptname = "rep_name_a" 'in pdf format DoCmd.OutputTo acOutputReport, rptname, acFormatPDF, , True End Sub