Syntax 4 For saving an OLE storage object to a file – PB Docs 126

Syntax 4 For saving an OLE storage object to a file

Description

Saves an OLE storage object to a file. If OLE controls have
opened the OLE storage object, this syntax of SaveAs puts
them in a saved state too.

Controls

OLE storage objects

Syntax

Argument

Description

olestorage

The name of an object variable of type
OLEStorage containing the OLE object you want to save.

OLEtargetfile

A string specifying the name of a new
OLE storage file. OLEtargetfile can include
a path.

Return Values

Integer. Returns 0 if it succeeds and
one of the following negative values if an error occurs:

  • -1 The storage is not
    open

  • -2 The storage name is invalid

  • -3 The parent storage is not open

  • -4 The file already exists

  • -5 Insufficient memory

  • -6 Too many files open

  • -7 Access denied

  • -9 Other error

If any argument’s value is null, SaveAs returns null.

Usage

The Open function establishes a connection
between a storage file and a storage object, or a storage file or
object and an OLE control. The Save function
uses this connection to save the OLE data.

When you call SaveAs for a storage object,
it closes the current connection between the storage object and
a file and creates a new file for the storage object’s
data.

For information about the structure of storage
files, see the Open function.

Examples

This example saves the storage object stg_stuff to
the file MYSTUFF.OLE. Olest_stuff is
an instance variable:

This example opens a substorage in one file and saves
it in another file. An OLE storage file called MYROOT.OLE contains
several substorages; one is called sub1. To
open sub1 and save it in another file, the
example defines two storage objects: stg1 and stg2.
First MYROOT.OLE is opened into stg1.
Next, sub1 is opened into stg2. Finally, stg2 is
saved to the new file MYSUB.OLE. Just as when
you open a word processing document and save it to a new name, the
open object in stg2 is no longer associated
with MYROOT.OLE; it is now connected to MYSUB.OLE:

See Also


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x