Exporting/Extracting an Access OLE object (Word document) to a Word document file

Exporting/Extracting an Access OLE object (Word document) to a Word document file

Post by junk1acc » Sun, 11 Jul 2004 00:21:12


I have been given an Access Database which contains a table that has
an OLE object field that contains a Word document. That table contains
hundreds of records. I would like to find out how I can write a VB
script, to be executed either within Access or executed at the CMD
prompt, which will loop through all the records and open the document
object and save it to a Word document that I can access from Windows
Explorer. An additional info is that I would like to export/extract it
to a Word document with a name that is stored in one of the other
fields of that record. I would also like to append a date timestamp
(YYYYMMDDHHMMSS) to the Word documents name just in case the name
field is not unique.

For example:

NAME DOCUMENT
docNameA Microsoft Word Document
docNameB Microsoft Word Document
docNameB Microsoft Word Document

The above table contains two fields, NAME = text datatype and DOCUMENT
= OLE object datatype. I would like loop through the 3 records and
create 3 Word documents with the names of docNameA20040708135601,
docNameB20040708135723 and docNameB20040708135724 respectively. Now
that I think of it, I guess I would have to build into the script a
second delay to ensure unique document names.

Anyway, your help with either example code or a point in the right
direction will be tremendously appreciated