Run time error 2282 RRS feed

  • Question

  • I receive the error message above. My code is as follows:

    End If
    DoCmd.SendObject acReport, stDocName, "RichTextFormat(*.rtf)", "", "", "", "", "", True, ""

    This emails a report in Word, and I would like to convert to Excel and update the code. How best should I revised the code above to correct the error and change to Excel?

    Thanks in advance for your assistance!

    Thursday, December 28, 2017 11:18 PM

All replies

  • Hi MissSuki,

    you had mentioned that," I would like to convert to Excel and update the code".

    to send the Report as Excel file you need to change the "OutputFormat" parameter.

    below is my Report in Access.


    Sub demo1()
        DoCmd.SendObject acReport, "report1", "MicrosoftExcelBiff5(*.xls)", "", "", "", "Query in XL Format", "This is the Body Text", False, ""
    End Sub

    Output when mail received:


    DoCmd.SendObject Method (Access)



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Friday, December 29, 2017 2:13 AM