FileDocument.ReadFromFile Method

The ReadFromFile method retrieves data that has been saved in a structured storage file, creates an appropriate data object, and returns the new object containing the saved data.

Syntax

FileDocument.ReadFromFile(FileName, Stream)

Parameters

FileName
A string containing the name of the structured storage file to read.
Stream
A string containing the name of the stream to read within the file. Thirty-one characters maximum.

Example

The following sample creates a Dictionary object named myDict, reads the values from the stream named IISProperties in the structured storage file named Site.csc, then copies these values to the Dictionary object, and returns the object:

Set myDict = FD.ReadFromFile(“Site.csc”, “IISProperties”)

Remarks

The object must support the IPersistStream interface.

The ReadFromFile method, unlike ReadDictionaryFromFile, creates the object into which the stream data is copied, then returns this object to the calling statement. An object created in this way cannot be saved in the Application object. To create a site dictionary that can be saved in the Application object, create the Dictionary object with Application scope, and then use ReadDictionaryFromFile.

The specified stream must be in the root storage of the structured storage file.

Related Topics


© 1997-1998 Microsoft Corporation. All rights reserved.