Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Error using SaveAs( ) with OLE control for MS-Word file

40 views
Skip to first unread message

Leonard Berman

unread,
Sep 11, 2009, 2:44:19 PM9/11/09
to
We have an application which inserts an MS-Word file into an OLE control and
then reads the data from the OLE control and stores the data in the
database. The stored data contains both the original data and the OLE
header.

Blob lbl_ole_data

Ole20.InsertFile( as_filename)

lbl_ole_data = Ole20.objectdata

We have a second application which reads the data from the database into an
OLE control and saves the original data to a file.

Blob lbl_ole_data

Ole20.objectdata = lbl_ole_data

Ole20.Activate(InPlace!) //
this line is for testing only

Ole20.object.SaveAs( ls_tempfilename, AsStatement!)

This technique works fine when the original MS-Word files were created on my
machine or on my colleague's machine. However, if the files were originally
created on one of our customer's machines, PowerBuilder returns the
following error.

"Error calling external object function saveas".

If I add the statement, Ole20.Activate(InPlace!), MS-Word is activated and
opens the document successfully on my machine.

I set breakpoints in both the error event and the ExternalException event of
the OLE control, but only the Error event is triggered.

Does anyone have any idea what might be causing the problem or how to get
more information on what is causing the problem? Is there an alternative
technique that I could use?

Thanks.

Regards,

Leonard Berman


0 new messages