Syntax 5 For saving an OLE storage object in another OLE storage
Description
Saves an OLE storage object to another OLE storage object
variable in memory.
Controls
OLE storage objects
Syntax
1 |
<span>olestorage</span>.<span>SaveAs</span> ( <span>substoragename</span>, <span>targetstorage</span> ) |
Argument |
Description |
---|---|
olestorage |
The name of an object variable of type |
substoragename |
A string whose value is the name of a |
targetstorage |
The name of an object variable of OLEStorage |
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 object in the OLEStorage variable stg_stuff in
a second storage variable stg_clone as
the substorage copy1:
1 |
integer result |
1 |
result = stg_stuff.<span>SaveAs</span>("copy1", stg_clone) |