Link to home
Create AccountLog in
Avatar of DarC69
DarC69Flag 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.
Avatar of DrTribos
DrTribos
Flag of Australia image

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?
ASKER CERTIFIED SOLUTION
Avatar of DrTribos
DrTribos
Flag of Australia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of DarC69

ASKER

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
Avatar of Martin Liss
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.