Displaying the Contents of OLE Items (Word and Excel Objects)

D

Don

For a tracking database we are working on, I would like to be able to show
(form) and print (report) the entire contents of a Word document (one per
record) linked via OLE. In experimenting with forms, I have not found a way
to display the whole Word document. The OLE control limits the viewable
area to its defined area on the form. I thought vertical and horizontal
scroll bars might be available, but could not find the control property for
them. While I have not experimented with reports, I suspect a similar issue
exists.

What are the accepted practices for displaying entire Word (or Excel) OLE
items?

Thanks!!

Don
 
J

John Nurick

Hi Don,

As you've discovered, the OLE control just displays a preview picture of
(usually) the first page of the document.

To see more, you have to "activate" the document, from the user
interface or VBA. This launches Word or Excel or whatever to open and
display the document, either in the control or in a new window.

A Word document can contain anything from a single line to thousands of
pages. Depending how an Excel workbook is setup, printing it can also
produce anything from a single number to thousands of pages. There's no
coherent way a control on an Access report could handle this.

So:
-on screen, activate the object and let the user scroll through it.
-for reporting, it's probably best to write VBA code that launches Word
(or maybe Excel) and creates the document you need.

By the way, even though Accesss offers the OLE field type and the
associated BoundObjectFrame control, it's usually better to keep Word,
Excel and other documents as disk files, storing just their names,
locations and metadata in the database table. This avoids problems with
the mdb file "bloating" (OLE objects are stored very inefficiently) and
makes document assembly simpler. See the DocMgr sample database at
http://www.datastrat.com/DataStrat2.html
 
D

Don

John,

You have confirmed what I expected the answer might be! Certainly will make
what I am doing a bit more complex. Oh well!

I was already working in the direction you suggested in terms of storing the
OLE object as a native Word or Excel document. Aside from the storage issue
you cited, I figured it would be easier to "end-around" the database front
end to edit the documents directly.

With regard to the report generation, do you have any thoughts on
interleaving the output. What I mean by that, there is data in the record
which relates to the OLE object (e.g. Word or Excel document). Would the
strategy in the code to have a loop that alternately opens a report which
prints the record data, then launches Word (etc) to print the OLE object
data?

Any comments will be appreciated!

Thanks for the help!!

Don
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top