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.
DarC69Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DrTribosCommented:
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?
1
DrTribosCommented:
The content controls, if you have not used them before, are cool because you can give them a tag and a title and you can select them by tag / title....

so you could have a set of controls with a tag called A then use VBA to select the set, something like:
Dim oCCs as ContentControls
Dim oCC as ContentControl
set oCCs = activedocument.contentcontrols.selectbytag("A")

for each oCC in oCCs ....

' and then write the value appropriate to that control...

Open in new window


[ Edit: actually I think the proper syntax is Set oCCs = ActiveDocument.SelectContentControlsByTag("A") ]
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DarC69Author Commented:
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.
0
DrTribosCommented:
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
0
Martin LissOlder than dirtCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.