Syntax
FileSaveAs [.Name = text] [, .Format = number] [, .LockAnnot = number] [, .Password = text] [, .AddToMru = number] [, .WritePassword = text] [, .RecommendReadOnly = number] [, .EmbedFonts = number] [, .NativePictureFormat = number] [, .FormsData = number] [, .SaveAsAOCELetter = number]
Remarks
Saves the active document with a new name or format. The arguments for the FileSaveAs statement correspond to the options in the Save As dialog box (File menu).
Argument | Explanation | |
.Name | The new name. If you don't specify .Name, the current folder and name are the defaults. If the document has never been saved, Word saves to a default name such as DOC1.DOC (Windows) or DOCUMENT1 (Macintosh). Note that if a document with the new name or a default name already exists, Word overwrites that document without prompting. | |
.Format | Specifies the new format: 0 (zero) Word document 1 Document template 2 Text Only (extended characters saved in ANSI character set) 3 Text Only with Line Breaks (extended characters saved in ANSI character set) 4 MS-DOS Text (extended characters saved in IBM® PC character set) (Windows only) 5 MS-DOS Text with Line Breaks (extended characters saved in IBM PC character set) (Windows only) 6 Rich-Text Format (RTF) You can return values appropriate for other formats by specifying a format name in a ConverterLookup() instruction. | |
.LockAnnot | If 1, locks the document for annotations. You can also lock a document with ToolsProtectDocument. | |
.Password | Sets a password for opening the document. | |
.AddToMru | If 1, places the document name first on the list of recently used files at the bottom of the File menu. (Note that MRU is an abbreviation for "most recently used.") | |
.WritePassword | Sets a password for saving changes to the document. | |
.RecommendReadOnly | If 1, displays a message upon opening the document suggesting that it be opened as read-only. | |
.EmbedFonts | If 1, embeds TrueType fonts in the document. | |
.NativePictureFormat | If 1, saves only the Windows version of imported graphics. | |
.FormsData | If 1, saves the data entered by a user in a form as a data record. Note the form must be unprotected or FileSaveAs generates an error. | |
.SaveAsAOCELetter | If the active document has an attached mailer, specifies how to save the document: 0 (zero) As a Word document (mailer is not saved) 1 or omitted As an AOCE letter (mailer is saved) This option is available only on the Macintosh and only if PowerTalk is installed. |
Example
This example saves the active document in rich-text format (RTF) with the filename TEST.RTF:
FileSaveAs .Name = "TEST.RTF", .Format = 6
See Also
Converter$(), ConverterLookup(), FileSave, FileSaveAll, Name, ToolsOptionsSave, ToolsProtectDocument