• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2214
  • Last Modified:

Embed Word Document in Access Report

I basically have a 2 page customer contract type of Word document that I need to create in an Access 2k application.  This document has a lot of formatting such as indentions, bold, numbering, etc. and it would be very difficult to try and re-create it from scratch just using a Access text box.  Therefore, I will embed the Word document into the Access report as a Object.  

I noticed where this option seems to only embed the 1st page.  Is there a way to embed a multiple page Word document or will I have to make each page in the original document a separate document??? Then embed the first, insert the Access Page Break and embed the second page of the contract into a its own object.

That will probably work but it just seems kind of redundant to make a separate Word Object in the Access report for each individual page although in this case it's only two.

Thanks,

ET
0
Eric Sherman
Asked:
Eric Sherman
  • 6
  • 2
1 Solution
 
puppydogbuddyCommented:
Hi ET,
If the word doc is in lieu of the report, I don't understand why you don't print the word doc directly using VBA.
0
 
Eric ShermanAccountant/DeveloperAuthor Commented:
Thanks for the reply pdb!!!

To answer your question ...

It really needs to be an Access report option for the following reasons ...

1.) Print, email (Snapshot format), etc. like all the other reports.
2.) Don't want to maintain the separate Word document in a folder somewhere as it will probably get deleted and or modified or opened in Word while another user is trying to use it in the Access application.
3.) The client environment uses a mixture of Office starting with '97, 2000, 2003 and 2007 for which there is no immediate plan to standardize all machine on one platform.  I've run into problems in the past using VBA with Excel there and the various references to other Office products like Excel & Word, etc.  Something as simple as opening a file and using the Save As command in VBA would not work on various machines and I spent a lot of time on that one to no avail.
4.) In other words, if I used that concept, based on past experiences, I'm pretty sure some of those machines will barf on the VBA code because of Reference issues, etc. and I really don't want to try and research all the differences between the various Office products used there just to print a document.

Therefore, make it an internal Access report object and it will work each time.

I can break it down into two objects then embed it into Access but since I've never really used that function before I was just curious thinking maybe I've missed something.

ET

ET

 
0
 
Eric ShermanAccountant/DeveloperAuthor Commented:
Plus ... one other reason is there will be some variable Customer information that will be pulled from the various tables in the db to "Auto-Fill" the contract document.
Fields, like customer number, name, address, effective date, various rates, etc. and it just makes it easier to have it as a report ojbect in Access as opposed to maintaining a separate Word document.

Thanks,

ET
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Helen FeddemaCommented:
I think you might be best off creating Word docs from a template (do all the formatting you need there), and writing the Access data to Word doc properties, which are then displayed in DocProperty fields.  This eliminates the need for a link to the Access database, and gives you a record of the report at a particular time.  See my Code Sample #24 (Four Ways to Merge to Word) for information on this technique, or my new ebook, Working with Word, which has Access 2007 examples.
I think it will be very difficult to get the results you want by embedding a Word doc in an Access report.
Here is a link for the code sample:  http://www.helenfeddema.com/Files/code24.zip
0
 
Eric ShermanAccountant/DeveloperAuthor Commented:
Thanks reply Helen ...

I'm actually trying to go the other way meaning get the document into Access and not merge from Access to Word.  As mentioned earlier, I can embed the Word document into a Access report object ... I was just having problems with multiple pages.

ET
0
 
puppydogbuddyCommented:
Hi ET,
I may be wrong, but I believe your problem might be due to embedding the word document in the wrong type of object frame....that you used an unbound object frame instead of a bound object frame for embedding purposes..  It is my understanding that an Unbound Object frame could only be used for  static views of a Word Document, which would not show multiple pages.  I think that a bound object frame can be used to view multiple pages of a Word Doc, or render word document images that change as you move between records and pages in the report to which it is embedded.  Hope this helps.
0
 
Eric ShermanAccountant/DeveloperAuthor Commented:
Thanks puppydogbuddy ....

I tried it with a Bound Object frame to no avial ... same results.  It will only display and print Page 1 of the document.  

I created a Table with a field WORD_DOC  and set the Data Type to OLE Object.  Inserted the Word Document into this field and used this table for the Record Source of my test report.  I then added the WORD_DOC field to the report using a Bound Object frame.  Again, same results ... only Page 1 will display and print.

Seems like I'm just missing a setting somewhere but I can't find it.  Maybe what I'm trying to do with the embedded Word document is not possible.  I will continue looking for a few more days.

Thanks,

ET Sherman
0
 
Eric ShermanAccountant/DeveloperAuthor Commented:
puppydogbuddy ...

Same results if you embed the multiple page document in Excel.  Seems like you can only get the first page.  There's got to be a way for the embedded document to print all pages within the document, I sure.

ET
0
 
Eric ShermanAccountant/DeveloperAuthor Commented:
Ok, after researching the net and EE, looks like using an embedded document you will only get the first page ... that option will not span multiple pages.  Therefore, for what I'm doing the approach would be to create a separate document for the 2 pages.  If it was longer, then I would look at going the other way and print the document from Word.

I just thought I was missing a setting somewhere that would allow the multiple pages to be printed from the embedded object.

Thanks all for your input.

ET
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now