Trying to export an Access report to MS Word

Maxine Nietz 1 Reputation point
2025-08-26T18:47:18.8466667+00:00

I am trying to write a macro or vba code that I can use to export an open Access report directly to Word. If there is no such thing, I could export it to PDF. Here is the macro I have written which is NOT working.

MacroIssue

Can you help??

Thanks in advance,

Max

Microsoft 365 and Office | Access | For home | Windows
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Michelle-N 6,685 Reputation points Microsoft External Staff Moderator
    2025-08-27T03:32:54.9566667+00:00

    Hi @Maxine Nietz

    Thank you for reaching out to the Microsoft Q&A Forum. 

    Based on the information you've shared, I understand that you're creating a macro in Microsoft Access to export a report named "CertificationReport". Your goal is to save it as a PDF with a dynamic filename based on the SoNo and LineNo values from the report.

    To better assist you, could you please provide the specific error message you receive when the macro fails? I have created a sample file in my own environment to replicate the situation. I encountered an error, as shown in the image below, which could be a possibility. User's image Regarding your primary goal of exporting to Word, you might find that using the Rich Text Format (RTF) is a more suitable option. Exporting to RTF creates a file that is easily opened and edited in Word, preserving much of the formatting just like a standard text document.

    Please refer: https://support.microsoft.com/en-us/office/export-access-data-to-a-word-document-6e954c8e-2243-4cb9-8544-607e5b7bfc12


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".    

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

  2. George Hepworth 22,080 Reputation points Volunteer Moderator
    2025-08-26T20:09:33.2133333+00:00

    It helps others help you when you include the actual results, not just "it's not working."

    I.e. Does it raise an error? If so, what error message is displayed? A screen shot of the error message is best.

    Does it export the wrong report?

    Does it not export anything?

    0 comments No comments

  3. ScottGem 68,765 Reputation points Volunteer Moderator
    2025-08-26T21:44:07.5833333+00:00

    First, if you want to be able to edit in Word its best to export as a RTF, not PDF. You can't export directly to DOC.

    This would be easier in VBA.

    Dim Outname as string

    Outname = "C:" etc

    DoCmd.OutputTo, acOutputReport, Reportname, acFormatRTF, Outname, True

    0 comments No comments

  4. Maxine Nietz 1 Reputation point
    2025-08-27T20:04:15.53+00:00

    I changed to macro to:

    User's image

    Now I just print to Adobe PDF, open Adobe, and convert to Word.docx

    Thanks anyway!

    Max

    0 comments No comments

  5. Ken Sheridan 3,291 Reputation points
    2025-08-27T20:43:41.3966667+00:00

    You might like to take a look at InvoicePDF.zip in my Dropbox public databases folder at: 

    https://www.dropbox.com/scl/fo/0scigd3r48hx5xrev2jrf/AB0-GMdTgMAO5O1cGdr3QW0?rlkey=ib6bs6g9jqcrywwzivur3265t&dl=0 

    This little demo file illustrates how to email a report (invoice in this case) to the relevant customers.  If you elect to email multiple invoices, a dialogue is opened in which multiple invoices can be selected in a list box.  If invoices to multiple customers are selected in a multi-select list box in the dialogue, separate emails will be generated to each customer. 

    Exporting a report to a Rich Text Format(RTF) file which you can edit in Word merely requires the file extension path to be changed, and the output format argument of the OutputTo method to be changed as follows: 

    strFullPath = varFolder & "\" & Me.Customer.Column(1) & " " & Me.InvoiceNumber & ".rtf" 
    
    DoCmd.OutputTo acOutputReport, "rptInvoice", acFormatRTF, strFullPath, True
    
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.