How to Fix Run-Time Error "5852"

Charlotte Simpson 1 Reputation point
2022-03-10T03:35:05.22+00:00

I just completed a mail merge using Microsoft Word. But what I want done after the merge is to save each letter to a pdf individually. I copied the following from a tutorial online and I'm getting a Run-Time Error "5852". I am NOT a VBA person so any help would be very helpful.

181712-screen-shot-2022-03-09-at-83402-pm.png

Office Visual Basic for Applications
Office Visual Basic for Applications
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Visual Basic for Applications: An implementation of Visual Basic that is built into Microsoft products.
1,496 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Andorra Lyu 16 Reputation points
    2022-10-24T07:00:54.29+00:00

    Hi,

    I've encountered the same problem and I got it resolved eventually. The VBA code I used was exactly the same as yours. So I think your case probably is the same -- the reason to have this error is that you haven't successfully linked the data source file to your mailling template (i.e., this MS Word document). So maybe you need to use the "Preview Results" button to examine whether the link has been built successfully. And remember to run the Macro in the template document (the one only has single page and links with your data source well), instead of the output integrated MS Word document with multiple pages.

    I'm just a beginner on VBA so I couldn't explain the deep causes but hope this can help!

    3 people found this answer helpful.

Your answer

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