SaveAs method

Official Content
This documentation is valid for:

Saves the document on a disk with a new name and, optionally, a new file type may be chosen.

Syntax

&WordDocument.SaveAs(FileName [ , FileType [ , DOSText [ , LineBreaks ] ] ] )

Type Returned:
Numeric

Where:

FileName
New name of the Word document.

FileType
New file type to be generated from the Word document.

Valid file types are:

DOC Word format
RTF Rich Text Format
HTM HyperText Markup/ HyperText Markup Language
DOT DOC Template

TXT (Text)
This parameter is optional. The default file type is DOC.

DOSText
If TXT type is specified, it is possible to specify whether the format of the text to be used will be DOS (1) or not (0). This parameter is optional. The default value is 0.

LineBreaks
If TXT type is specified, it indicates whether a line break will be added at the end of each line (1) or not (0). This parameter is optional. The default value is 0.

Note

This method returns an error code, so it is possible to call it as a function (&Err = &WordDocument.SaveAs(…..)).

Scope

Extended data types WordDocument Data Type
Languages .NET, Java, Ruby, Visual FoxPro
   

See also

Save Method for excel document and word document extended data types
WordDocument Data Type