OpenFile()

Syntax:

OpenFile( Filename, Overwrite, ReadOnly )

Return:

A new object, which has a variety of properties, such as, Read and Write. The properties can be manipulated using OpusScript File functions.

Parameters:

Filename – enter the full pathname of a text file. Filename should be the full pathname of the text file or the alias name given to the file in the Additional Resources tab of the Page Properties or Publication Properties dialog. This parameter is required.

Note:

Pathnames normally contain backslashes e.g. d:\welcome.txt, all single backslashes should be entered as double backslashes i.e. d:\\welcome.txt.

If Filename is not found, then the file is created automatically.

Overwrite – overwrite the file specified. Overwrite can be true or false. If true it overwrites the current file. If false, the data is written to the end of the file. This parameter is optional and the default is false.

ReadOnly – set the read-only mode of the file. ReadOnly can be true or false. If true the file will be opened in read-only mode (i.e. no changes can be made to the file) – this also means the Overwrite parameter cannot be true if ReadOnly is true. If false, the file can be changed. This parameter is optional and the default is false.

Remarks:

This function will create a new OpusScript object that will allow you to manipulate the contents of the specified text file using File functions. If the specified file is not found, this function will create the file for you.

image\Script_Button.jpgExamples