C
Chuck
On 2-4-2005 9:05, I asked how I could open an image file ( a Word document
actually) from an SQL table with VBA code. This would be similar to opening
the table, right-clicking the record and choosing the "Document Object |
Open" menu item.
I got one response saying that that is probably not possible and after
searching for quite a while, I would probably have to agree.
So I guess I would have to save the file to the user's computer first and
then open it with Word automation. I have found code that works to save a
binary data type to the desktop (see below) but it does not work with an
image type, at least not when the image type is a Word document. The file
saved to the computer is not readable by Word. So how can I save an image
type object to the desktop (from an ADP project with SQL backend using ADO)?
Thanks
I guess I could save the Word file as a binary data type but I would prefer
to use an image type since I can simply drag-and-drop the document into the
table. I can't do that with a binary data type.
' Code to save binary record to computer.
Set BinaryStream = CreateObject("ADODB.Stream")
BinaryStream.Type = adTypeBinary
BinaryStream.Open
BinaryStream.Write Request.BinaryRead(Request.TotalBytes)
BinaryStream.SaveToFile "c:\myfile.doc", adSaveCreateOverWrite
actually) from an SQL table with VBA code. This would be similar to opening
the table, right-clicking the record and choosing the "Document Object |
Open" menu item.
I got one response saying that that is probably not possible and after
searching for quite a while, I would probably have to agree.
So I guess I would have to save the file to the user's computer first and
then open it with Word automation. I have found code that works to save a
binary data type to the desktop (see below) but it does not work with an
image type, at least not when the image type is a Word document. The file
saved to the computer is not readable by Word. So how can I save an image
type object to the desktop (from an ADP project with SQL backend using ADO)?
Thanks
I guess I could save the Word file as a binary data type but I would prefer
to use an image type since I can simply drag-and-drop the document into the
table. I can't do that with a binary data type.
' Code to save binary record to computer.
Set BinaryStream = CreateObject("ADODB.Stream")
BinaryStream.Type = adTypeBinary
BinaryStream.Open
BinaryStream.Write Request.BinaryRead(Request.TotalBytes)
BinaryStream.SaveToFile "c:\myfile.doc", adSaveCreateOverWrite