Access 2007: Trying to display multi-page Word document within control

pk2317

New member
Local time
Today, 05:32
Joined
Oct 15, 2010
Messages
4
What I'm trying to do:

Within my database, I have a table with approximately 80 entries. Each entry is associated with a Word document and up to 2 Excel documents. The majority of the Word documents are 2-3 pages long.

I also have a form that contains a dropdown list for the primary key on this table. When a user selects a value from that list, I need to have the associated Word document appear in a control on that form, with scroll bars on the side.

Ideally, I would like to have a separate form where the user can select a number from a dropdown, and then can switch between the Word document and the 2 Excel documents using command buttons, and have them display within a control on the form. However, if this proves too difficult, this secondary form can just launch the files in their native applications in a separate window (which I already know how to do).

My limitations:

The back-end of the database is going to be stored on a Sharepoint site, so I cannot use the OLEObject field in my table, because it does not support it.

It doesn't make a huge difference if the files are stored within the database (as Attachments) or externally (as separate files with links stored as text). But I can't just cut & paste the data, because these documents will likely need to be modified in the future, and they need to continue to be stored as Word files.

If I do store them as attachments, Sharepoint will only allow a single file for each record in the table (even though Access allows multiple attachments as a multi-value field). I have two workarounds, one is a separate table with three records tied to each primary key value, and another field distinguishing what type of file they are (so I can retrieve the right file using an SQL query). Alternatively, I can just store the Word document as the single attachment, and link to the external Excel files (which is slightly more confusing, but doable).

The problem with attachments is that, as far as I can tell, the "attachment" control on the form does not actually display the attachment, unless it's an image. From my research online, it seems that for non-image files it only displays an icon representing the file, which you can double-click to open. I want the contents of the document to display.

For a while it seemed like using an Unbound Object Field and linking to the separate file would work, and it almost does. The problem is that it only returns the first page of the document, and almost all the documents are 2-3 pages.

My thoughts:

I've considered creating a temporary table through VBA code, creating a record containing an OLEObject field, and importing the file data to display it in a Bound Object Field. However, I don't know if that will work with Sharepoint, or if it will drastically slow down performance every time someone changes their selection.

I've also considered converting the file data to a BLOB, and trying to import and display it that way. I don't know a whole lot about this, or if it's a good idea or not.

Is it possible to convert on-the-fly the contents of a Word document to, say, HTML so it can be displayed in a RichText Memo textbox? This might also be a solution, as long as everything displayed correctly. It probably wouldn't work as well with the Excel files, but the Word file is my main concern.

Thank you very much for taking the time to read this and give me your feedback, if this is in the wrong forum please move it as necessary.
 
My suggestion - just store the links and open the document when the user needs it. Don't try to include it in your form as I think it will drive you crazy trying to get it to work just right. I had built a document viewer for an employer that I used to work for so that they could give it to this company which had bought out part of their business. We had images and Word documents and for each of them I didn't try to include it in Access but called the appropriate tool outside and opened it up there.
 
Thanks for the reply. The probem is that I've been tasked to build this database from the ground up, and one of the main selling points is the ability to do this. So I really have to find *some* way of doing it.

The general idea is that this database will be used for incident response. When something happens the user can open the database, enter the code for what type of incident is occuring, and a form will open. This form automatically pulls up what kind of information needs to be collected, and puts that information into the form "labels" (actually unbound text boxes). On the left side of the form is a large control, this will hold the reference document so the responder can refer back to it at will without having to leave the form. See diagram:

Code:
-----------------------------------------
| [#]User enters #                      |
|                ___                    |
| ---------   X [___]                   |
| |       |      ___   \                |
| | Doc   |   Y [___]  --Bound text     |
| | Shows |      ___   /       boxes.   |
| | Here  |   Z [___]                   |
| |       |                             |
| |       |   X,Y,and Z auto-populate   |
| ---------   based on #. User enters   |
|             info in bound text boxes. |
-----------------------------------------
 
For selling points you probably should ensure that it is possible to do before touting them. :)

Good luck, I hope you find the solution.
 
Hehe, good to know for the future :)

The annoying thing is that it does work with an OLEObject field, I tested (and demonstrated) that almost before anything else. It wasn't until I was researching Sharepoint connectivity that I realized it would be an issue. That's why I'm wondering if it's possible to create a temporary table with an OLEObject field to store this.
 

Users who are viewing this thread

Back
Top Bottom