Avatar of CroetOne
CroetOneFlag for Netherlands asked on

embed a multiple page Word document in an Access report

I have a Access main report that consists out of 10 sub reports. Depending on the data in the table "reports_to_print_for_customer", 4 to 6 sub reports are printed. Each record in that table represents 1 of the sub reports to be printed for the customer. The amount of sub reports is different for each customer. One of the sub reports is a multiple page Word document.
I have merged Word and Access reports before using pdf-merge (the Word document printed as the last page of the report set or always as the 3th or 2nd page) or printed a single page document as an object within the report.
Those solutions are not applicable in this case. It is not determined if the Word document is in the set and if it is, in which sequence the set is.

My approach is to define a sub report (as the other sub reports) en somehow let that sub report print the Word document when required (based upon the data in the table).
But how do I set up that sub report that it can print the Word document as part of the main report?
I have searched internet groups but that didn't give any workable solution. It almost looks like I want something that is not possible to do, or it is so simple that no one had to ask that question before....

I appreciate any help because for now I am stuck!
Microsoft AccessVBAMicrosoft Word

Avatar of undefined
Last Comment

8/22/2022 - Mon
John Tsioumpris

The description without some kind of a sample is a bit confusing at least for me.
All I can say that everything is pretty much doable and since Word is the key word then "maybe" a good idea would be to use Word automation.
This would go like this...you will pull all the info from Access and start constructing a new Word document.
Everything you need would be "injected" into this Word document...you could have a base template or you could start entirely from scratch.

Hi John,
I do understand that the description is to much in a helicopter view. Let me try to explain some more. The Access reports are based upon data in a SQL Server database. Monthly we have to report our customers with account views, transaction reporting and return on investment data.
That are all different sub reports, embedded in one big report. Based on de data in de "reports_to_print_for_customer" table, the main report has the ability to set the visibility for the named report in the records for a specific customer on TRUE and the main report prints the sub reports, as required in one pdf file.
For the reports based upon the data in the SQL Server data base, this is a running process and works fine for me.
But now, we need to add a explanatory which consist out of several pages and has columns, pictures and graphs. It is a commercial document to explain our asset management strategy for the upcoming period.
This document is made up in Word and should be some where in the middle between the sub reports.

Hope I have given a better view on the case and always willing to explain more.

John Tsioumpris

Now its a bit clearer.
My take would be to export the Access Reports to PDF, export the Word to PDF and use PDF merging to one big PDF.
So if the Word is going to get displayed then Word is exported ..if not ommit it.
After all PDF is the most versatile Document format.
Are you hunting something more elaborate ?
Your help has saved me hundreds of hours of internet surfing.

@John: Okay. I was hoping for a solution to handle the Word document in a sub report. The record in the table "reports_to_print_for_customer" has the name of the sub report that is connected to the Word document and the sequence number to get the sub reports in the correct order. The sequence of sub reports could be: 
  1. Table of content and summery;
  2. Our asset management strategy (the Word document);
  3. Position report;
  4. Transaction overview;
  5. return on investment report.
In our CRM application the parameters to populate the table "reports_to_print_for_customer" are maintained by our sales and account management team. So it is unpredictable which sub report and in which sequence will be printed. The Word document is just one of the sub reports.
The main report will be executed in a monthly batch run as part of our administrative production. Therefor I hoped to find a more sophisticated solution.
John Tsioumpris

So ...you are looking for some kind of embedding .
Take a look if this is what you after : https://bytes.com/topic/access/answers/816914-can-word-document-inserted-into-access-report

@John: Using a object and connecting a Word document to that object is something I already use for single page documents. But when working with multiple pages per document, this solution does not work because the object is not able to stretch over the page limit.
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
John Tsioumpris

So back to square one.
IMHO either full Word automation like creating just about everything from scratch like paragraphs /tables/images ...(there is no limit) or
creating PDFs and manipulating a Word template to match your needs.
Just create these separate 5 reports and merge them : https://www.tek-tips.com/viewthread.cfm?qid=1640782 (UNTESTED)

@John: I will keep your recommondation in mind, looking for a way to use the current automation.  Thanks so far!

I found my own solution but did not had the time to describe that solution here. I will do that in the next few days, so please leave this open for me to comment.
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question