- Dan Harrel
- PowerBuilder
- Wednesday, 31 January 2018 03:38 PM UTC
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!
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.