We use the olecontrol.insertFile (...) method to populate an olecontrol object with a file system document - for example, "foo.xlsx".
How can we now extract the document out of the olecontrol, and write it back into a file system document?
We know we cannot do the following, at least for complex documents such as XLSX spreadsheets:
blob blob_objectData
int i_rc, i_file
long l_rc
i_rc = ole_1.insertFile ("C:\temp\foo1.xlsx")
blob_objectData = ole_1.objectdata
i_file = fileOpen ("C:\temp\foo2.xlsx", StreamMode!, Write!, LockWrite!, Replace!)
l_rc = filewriteEx (i_file, blob_objectData)
i_rc = fileClose (i_file)
Basically we are looking for something that is conceptually an "olecontrol.extractFile (...)" method. Does anyone have a suggestion on how to do this?
The real-world problem we are trying to solve is as follows: Application users embed document files such as spreadsheets in our database. How can we automate exporting these database-stored documents back into document files without having to activate each one interactively and performing a "Save As..."?
Thanks!