1) if the Office documents are stored as embedded objects, the simplest
approach seems to be bind a form to the table and automate a
BoundObjectFrame control; see http://support.microsoft.com/?id=132003
for sample code.
2) if the SQL Server columns simply store the contents of the Office
files (i.e. without the OLE packaging), open a recordset on the table
and use GetChunk() to extract the contents into a variable, then write
it to disk.
On Tue, 1 Nov 2005 00:56:06 -0800, Zvi <Z...@discussions.microsoft.com>
wrote:
>I have the database on access 2000 / SQL server.
>A table have columnd with embedded office (column Word, and Column Excell)
>files.
>I want to export all documents to files
>
>I do not want to do it manually, there is about 600 Documents
>
>please, help me.
--
John Nurick [Microsoft Access MVP]
Please respond in the newgroup and not by email.
Dim oXL As Object
Dim strFileSpec as String
'Filename:
strFileSpec = "C:\Folder\File.xls"
'Activate the embedded document in an instance of Excel
Me.Ole1.Action = acOLEActivate
'get hold of the instance - assumes that there is only the one
'Instance of Excel running
Set oXL = GetObject(, "Excel.Application")
'Save the document
oXL.Workbooks(1).SaveAs strFileSpec
'Close it, leaving Excel running ready to process the next record
oXL.Workbooks(1).Close False
'Or close Excel if you are just exporting one document
'oXL.Quit
You can use the same approach with Word as an alternative to the
copy-and-paste in the Microsoft knowledgebase article.
On Tue, 1 Nov 2005 23:47:03 -0800, Zvi <Z...@discussions.microsoft.com>
wrote:
Using automation will work I believe for Office applications or other apps
which register with the OLE server, but I have had no luck with automation
and Packages because the .Object method of the OleBoundControl does not work.
The OleBoundControl seems to be able to properly identify and process all
types of embedded documents, including packages. I am thinking that there
has to be a way for us to do what Microsoft's OleBoundControl is doing so
that we too can identify what is in the OLE fields and process it accordingly.
Thanks
Having to use the BoundObjectFrame is one of the reasons many people
avoid embedding documents in OLE fields: usually it's simpler to leave
the documents in disk files and just store the filespecs, or to store
the contents of the file in the database (as opposed to a packaged OLE
object containing the file).