TechWhirl (TECHWR-L) is a resource for technical writing and technical communications professionals of all experience levels and in all industries to share their experiences and acquire information.
For two decades, technical communicators have turned to TechWhirl to ask and answer questions about the always-changing world of technical communications, such as tools, skills, career paths, methodologies, and emerging industries. The TechWhirl Archives and magazine, created for, by and about technical writers, offer a wealth of knowledge to everyone with an interest in any aspect of technical communications.
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
Lisa:
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
well).
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:
INCLUDEPICTURE "DATABASE \d "C:\\WINDOWS\\DESKTOP\\AFSMan2.mdb" \c "TABLE
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
**********************************
Ed Klopfenstein
Senior Technical Writer
Accu-Fab Systems, Inc.
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
the
database is to store information. I have the OLE fields (Insert
Object-->Word
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
documentation
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.