RE: Access OLE Object Export to Word

Subject: RE: Access OLE Object Export to Word
From: "Klopfenstein, Ed (AFS)" <edk -at- accu-fab -dot- com>
To: "Miller, Lisa" <Lisa -dot- Miller -at- Anheuser-Busch -dot- com>
Date: Thu, 9 Sep 1999 16:43:41 -0700


Great lunchtime problem. Hopefully, this helps.

Instead of trying to handle objects directly (which bloat your database and
word files), try inserting paths into Word's INCLUDEPICTURE or INCLUDETEXT
fields. This way, you can edit and format your documents and pictures and
just handle text paths instead of the objects themselves.

Assuming you already spent days inserting objects in your database, you can
save time by: 1) creating a new "text" field in your table and 2) using VBA
to loop through your current "Object" field rows and output a 'path' value
to your new text field (simple FOR EACH and Recordset.Edit statements work

With your database set up, go back to your Word templates and create an
INCLUDEPICTURE or INCLUDETEXT field. Where the field asks for a path, insert
a database field that links to your database and pulls the correct path
value. The DATABASASE field's SQL query would look like this:

Experiment" \s "SELECT [path] FROM [Experiment] WHERE (([Number] = 1))" "

This would pull the path value where the unique row ID is "1".

The trick is querying your database to get the right path into the right
INCLUDE field. This is where the SQL reserved words WHERE and AND come in
handy. You can use these reserved words to link the values from custom Word
properties to your SQL statement in Word. For instance, you could create a
unique one-to-one relationship between an Access field value and a Word
property, like "ProjectNumber" and a Word property called "ProjectNumber".
In the above example, you would replace the WHERE statement --
(([Number]=1)) -- with WHERE (([ProjectNumber]=\"DOCPROPERTY "ProjectName"
\")). Once you open your Word file, open File | Properties and enter a value
to the custom property "ProjectName". Update all values by doing a select
all and pressing F9 and walla, your document is updated.

This method would insert objects without having to include bulky objects in
your datase. We use something similar to this to build our standard
documents and make sure all information is up to date. It has saved us a lot
of rewriting and updating time.

Lisa, tell me if this works for you. I'd be glad to help if you need it.


Ed Klopfenstein
Senior Technical Writer
Accu-Fab Systems, Inc.

541.758.3469, ext.321
Mailto:edk -at- accu-fab -dot- com

Lisa Wrote:
I have created and Access database for storing my information
objects, but I am
unable to export embedded Word objects back to Word. The reason for
database is to store information. I have the OLE fields (Insert
Document) to enable Word's word processing functionality. I want to
export back
to Word in order to create a variety of document types based on my
requirements. As it stands now, when I "Publish," "Save As," or
"Mail Merge" I
don't get the contents of the OLE object, I get an empty result or
"Long Binary
Text field" in the field in the receiving document.

Does anyone have any suggestions?

Previous by Author: Doc Pricing Question
Next by Author: Indexing in Word
Previous by Thread: Access OLE Object Export to Word
Next by Thread: H1 visa sponsorship

What this post helpful? Share it with friends and colleagues:

Sponsored Ads