FileDocument.WriteToFile Method

The WriteToFile method writes data from a data object (such as a Dictionary object) into a specified stream in a structured storage file.

Syntax

FileDocument.WriteToFile(FileName, Stream, Object)

Parameters

FileName
A string variant containing the name of the structured storage file to write.
Stream
A string variant containing the name of the stream to write within the file. Thirty-one characters maximum.
Object
A variant specifying the data object containing the information to be saved in the file.

Remarks

The object must support the IPersistStream interface.

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

Example

The following Microsoft® Visual Basic® Scripting Edition (VBScript) example saves the contents of the Dictionary object called Dict to the stream called myStream of the specified file:

Set Dict = Server.CreateObject(“Commerce.Dictionary”)
Set FileDoc = Server.CreateObject(“Commerce.FileDocument”)
Dict(“MyOrder”) = “My Data”
Call fileDocument.WriteToFile(“C:\temp\test.txt”, "myStream", Dict)

Related Topics


© 1997-1998 Microsoft Corporation. All rights reserved.