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.
FileDocument.ReadFromFile(FileName, Stream)
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”)
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.