Attaching Word docs to database

  • Thread starter Thread starter Tony Williams
  • Start date Start date
T

Tony Williams

Is it possible to "attach" a Word document to a form. I know how to
hyperlink and open the file in a different directory but I would like to
have the Word document as part of the form and open it with a command
button?
Does that make sense?
Tony Williams
 
Tony Williams said:
Is it possible to "attach" a Word document to a form. I know how to
hyperlink and open the file in a different directory but I would like to
have the Word document as part of the form and open it with a command
button?
Does that make sense?

You can embed or link a Word document in an OLE control. Be aware that OLE
controls, including Memo fields are more prone to corruption because the
data is stored on another page in the database with a pointer from the
current record. When the pointers get messed up due to a dropped packet, you
get corrupted records.

You can store the path and use a hyperlink or perhaps you'd have better
results with ShellExecute:

http://www.mvps.org/access/api/api0018.htm

You can also use OLE automation to start an app to a specific document. See
my website for an example:

http://www.datastrat.com/Code/WordMerge.txt
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access
 
Thanks Arvin. What I was trying to do was probably dicky anyway. I am
building an index system for an organisation that wants a database of all
the documents, minutes, technical papers etc they produce. These documents
are either Word or Excel or PDF files and are stored in separate directories
on a server. I wondered whether it was possible to store the different
documents with the database record so that they wouldn't have to "go and
find" the document with a command button eg have the document as say a
second page of a multipage form. Thinking about it some more it might be
dangerous because I suppose if the database gets corrupt they could loose
all their documents as well. Thanks for the two references though it's given
me ideas of a better way to handle this.
Tony
 
Back
Top