Visual Basic Reference

Visual Studio 6.0

SaveToFile Method

See Also    Example    Applies To

Saves an object to a data file. Doesn't support named arguments.


object.SaveToFile filenumber

The SaveToFile method syntax has these parts:

Part Description
Object An object expression that evaluates to an object in the Applies To list.
Filenumber Required. A numeric expression specifying the file number used when saving an object. This number must correspond to an open, binary file.


Use this method to save ActiveX components. To save an ActiveX component in the OLE version 1.0 format, use the SaveToOle1File method instead.

If the object is linked (OLEType = vbOLELinked, 0), only the link information and an image of the data is saved to the specified file. The object's data is maintained by the application that created the object. If the object is embedded (OLEType = vbOLEEmbedded, 1), the object's data is maintained by the OLE container control and can be saved by your Visual Basic application.

You can load an object saved to a data file with the ReadFromFile method.