SaveAs Method

See Also         Example         Applies To

Saves the specified document with a new name or format. The arguments for this method correspond to the options in the Save As dialog box (File menu).

Syntax

expression.SaveAs(FileName, FileFormat, LockComments, Password, AddToRecentFiles, WritePassword, ReadOnlyRecommended, EmbedTrueTypeFonts, SaveNativePictureFormat, SaveFormsData, SaveAsAOCELetter)

expression   Required. An expression that returns a Document object.

FileName   Optional Variant. The name for the document. The default is the current folder and file name. If the document has never been saved, the default name is used (for example, Doc1.doc). If a document with the specified FileName already exists, the document is overwritten without the user being prompted first.

FileFormat   Optional Variant. The format in which the document is saved. Can be one of the following WdSaveFormat constants: wdFormatDocument, wdFormatDOSText, wdFormatDOSTextLineBreaks, wdFormatEncodedText, wdFormatHTML, wdFormatRTF, wdFormatTemplate, wdFormatText, wdFormatTextLineBreaks, or wdFormatUnicodeText. To save a document in another format, specify the appropriate value for the SaveFormat property of the FileConverter object.

LockComments   Optional Variant. True to lock the document for comments.

Password   Optional Variant. A password string for opening the document.

AddToRecentFiles   Optional Variant. True to add the document to the list of recently used files on the File menu.

WritePassword   Optional Variant. A password string for saving changes to the document.

ReadOnlyRecommended   Optional Variant. True to have Word suggest read-only status whenever the document is opened.

EmbedTrueTypeFonts   Optional Variant. True to save TrueType fonts with the document.

SaveNativePictureFormat   Optional Variant. If graphics were imported from another platform (for example, Macintosh), True to save only the Windows version of the imported graphics.

SaveFormsData   Optional Variant. True to save the data entered by a user in a form as a data record.

SaveAsAOCELetter   Optional Variant. If the document has an attached mailer, True to save the document as an AOCE letter (the mailer is saved).