Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Saving a Word.doc in Access

Status
Not open for further replies.

IndyGill

Technical User
Jan 15, 2001
191
GB
Hi all

I was wondering is it possible to save a Word document in Access. I have a Row of Data and want to include/attach a file which is a Word document. Is it possible to save the document within Access or do I have to use a hyperlink to the relevant .doc file.

I am reluctant to use hyperlinks to the file as Directory Structures change.

many thanks in advance
 
The easiest way is to have a field with type of ole. When entering you word doc you insert and object into this field. Thus the document is actually linked to a record and embedded in you database. Only drawback is the space that it could take up.
 
There is a way to prevent the drawback (bloating your database file). You simply have to set a reference on the Word!With Access library (powerup found on We use it for a lawyer's application and it works very well.
 
How would you go about this OLE linking and embedding? Is this a task that can be automated if you have a large number of doc files?
 
Its simple to implement, just create a field on the table and select OLE Object in the type drop down box. From there when you create the form all you have to do is drag and drop the required document and its attached!

Sorted :)
 
We have over two thousand word files that I would like to dump into a database to make them easier to maintain and search through. Can I automate the ole process to use the name of the doc file as an ID for the table and let it search my directories?
 
I would also be interested in learning how to store Word Document Objects into Access 97 ole object fields using Visual Basic.

If I try to store the document object in the appropriate field in the normal way, such as:

rcsDoc.AddNew
rcsDoc("Document") = msWord 'where msWord is a Word
document object
rcsDoc.Update

Something gets stored, identified as "Long Binary Object" rather than "Microsoft Word Document" (as is the case if 'inserted' using Access) and is inaccessible (won't open when double-clicked from Access).

Any help would be greatly appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top