Storages & Files CreateStorageFile
CreateStorageFile method 

Creates OLE compound file (also known as storage file) and returns a SFStorage object for its root storage (the only storage in it at the time of its creation).


Set stg = object.CreateStorageFile(name [,SF_Flags])


name - the file system name for the OLE file. The file is created in the file system under the specified name and location.


Set sf = Server.CreateObject("newObjects.utilctls.SFMain")
Set stgFile = sf.CreateStorageFile("C:\Directory\mystorage.stg")
' Create a stream in it
Set strm = srgFile.CreateStream("MyStream")


The storage files are like virtual file systems implemented in a file. Internally they have directory structure (storages) and streams (equivalent to files) in these storages. See OLE Files for more information.

Usually you the application will need to check if certain OLE file already exists and the FileExists method will not be enough because it will only check for the file existence but not its nature (is it an OLE file or not). SFMain provides the IsStorageFile method to help the applications determine if certain file is actually an OLE file.

Applies to: SFMain object

Supported on:

Windows 95/NT and later
Windows CE 3.0 and later
Pocket PC/Windows Mobile 2003 and later
Windows CE.NET 4 and later


newObjects Copyright 2001-2006 newObjects [ ]