View Single Post
 
Old 09-03-2020, 10:16 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,164
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

I didn't give you feedback on the various other inputs you are taking. I think you are being drowned in information from some very different approaches and end targets. All are very useful as study tools but some may not suit your actual requirements particularly well.

The youtube 'Push Data from Excel to MS Word Content Controls using Excel VBA' video shows a simplistic method of pushing your data to Word. If you had an understanding of that code, you could rewrite it to run from Word to 'pull' the data across. You would however need to be a lot smarter about getting the right data to go into the right CC - and that would need more code.

The youtube 'How to use ADO and VBA to Read from Worksheets' gets you access to the Excel recordset and from there you are going to have to work out how to align the matrix of records x fields with locations in your document where those particular values need to go. A recordset allows you to grab the data quickly and also to search through it for a particular record or assigned sort order but it doesn't help you align that content with the locations in your document.

In the case of Greg's inputs - he is showing you code to write all the records (a column from Excel) as entries in a single Dropdown Content Control. This will effectively be a single 'name' in the Word document and you can click on the CC and choose a different name. The earlier code showed a method of taking that chosen name and transferring the associated 'row' data into other CCs in the document. This ultimately gives you a single record's worth of data in the Word doc but not all the records (rows) at once.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote