void SaveToFile( String sPathName <, String sFileType> )
String sPathName
The fully qualified path and filename to which the LISTING output document should be saved.
String sFileType
The name of the file format in which the LISTING output document should be saved. The valid format names are RTF and TXT. The string sFileType is not case sensitive. If you do not
specify sFileType, the filename extension of sPathName determines the format of the file.
This method saves the LISTING output document to a file. The method can save the document in one of two formats: Rich Text Format (RTF), or Plain Text (TXT). If you specify the parameter sFileType, that parameter determines the format in which the LISTING output document is saved. If you do not specify the parameter sFileType, the filename extension of sPathName determines the format in which the LISTING output document is saved. In this latter case, the filename extension must be either ".rtf" or ".txt".
If you save the LISTING output document in TXT format, formatting and graphics are not preserved.
If you save the LISTING output document in RTF format, Enhanced Metafile (EMF) graphics are not preserved correctly. This is a limitation of the Windows Rich Text Edit control with which the LISTING output document window is implemented.
print "Hello"; print "World"; run GetPersonalFilesDirectory( path ); OutputDocument.GetDefault().SaveToFile( path+"Example.txt" );