saveAsDocument method

This method saves the document with a new name or format.

Defined in

Document

Syntax

public void saveAsDocument(String fileName, String fileFormat) throws SymphonyException

Parameters

String fileName

Specifies the new name of the document to be saved and must contain the file path. For example, on Microsoft® Windows® , the format is D:\\test.odt . On Linux®, the format is /home/me/test.odt.

String fileFormat
Specifies the format of the document to be saved. The following file formats are supported:
  • .odt file: Constant.SYMPHONY_FILE_FORMAT_ODT
  • .ott file: Constant.SYMPHONY_FILE_FORMAT_OTT
  • .doc file: Constant.SYMPHONY_FILE_FORMAT_DOC
  • .rtf file: Constant.SYMPHONY_FILE_FORMAT_RTF
  • .txt file: Constant.SYMPHONY_FILE_FORMAT_TXT

Usage

If the file path does not exist, this method throws an exception.

If the file format is not supported, this method throws an exception.

If the file already exists and the document is in visible mode, prompt asks if the existing file should be overwritten.

If the file already exists and the document is in invisible mode, this method overwrite the existing file.

See examples

Example: saveAsDocument method

Related information

File format constant