Avatar of DarC69
Flag for Ireland asked on

How do I get Excel to export data to Word templates and save individual documents as both word and PDF document

I currently have an excel spreadsheet which contains data that is entered via a form designed using excel VBA. This form allows a user to enter data once but populate 2 different worksheets which are formatted in different ways in order to facilitate the production of 2 different word documents.
I currently have the code working within Excel to handle the data entry into the spreadsheet and data is being populated as required.
What I need to do is push this information from the individual worksheets to a corresponding word template and save individual copies of the produced documents to the local hard drive as both a word document and a PDF file.
I have a tried a few ways to do this but I am running into a number of issues which have caused me to add/edit and delete code over the last few days and I'm still getting nowhere.
Any help or direction that someone can give me in order to get the automation process working would be very much appreciated.
Microsoft ExcelMicrosoft WordProgrammingVBA

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon

In MS Word you have the ability to add content controls which you can then map to each item of information from the spreadsheet (assuming that is possible).  What approaches have you tried?

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.

I initially considered just using mail merge but this didn't really deliver what I needed. However these documents were the initial starting point for the templates as they pick up the data correctly.

I have tried to use bookmarks unsuccessfully although I'm sure they could probably work.  

With regard to Content Controls I am not familiar with them so I can give them a try and see how I get on thanks for the suggestion.

Content controls are much more stable than bookmarks and you can also specify styles and more. Enable the developer tab in word. Also Google for Greg Maxey. He has some good articles on them. Good luck
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Martin Liss

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.