Edytuj

Udostępnij za pośrednictwem


_Document.SaveAs2 Method

Definition

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

public void SaveAs2 (ref object FileName, ref object FileFormat, ref object LockComments, ref object Password, ref object AddToRecentFiles, ref object WritePassword, ref object ReadOnlyRecommended, ref object EmbedTrueTypeFonts, ref object SaveNativePictureFormat, ref object SaveFormsData, ref object SaveAsAOCELetter, ref object Encoding, ref object InsertLineBreaks, ref object AllowSubstitutions, ref object LineEnding, ref object AddBiDiMarks, ref object CompatibilityMode);
abstract member SaveAs2 : obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj * obj -> unit
Public Sub SaveAs2 (Optional ByRef FileName As Object, Optional ByRef FileFormat As Object, Optional ByRef LockComments As Object, Optional ByRef Password As Object, Optional ByRef AddToRecentFiles As Object, Optional ByRef WritePassword As Object, Optional ByRef ReadOnlyRecommended As Object, Optional ByRef EmbedTrueTypeFonts As Object, Optional ByRef SaveNativePictureFormat As Object, Optional ByRef SaveFormsData As Object, Optional ByRef SaveAsAOCELetter As Object, Optional ByRef Encoding As Object, Optional ByRef InsertLineBreaks As Object, Optional ByRef AllowSubstitutions As Object, Optional ByRef LineEnding As Object, Optional ByRef AddBiDiMarks As Object, Optional ByRef CompatibilityMode As Object)

Parameters

FileName
Object

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 file name already exists, the document is overwritten without prompting the user.

FileFormat
Object

The format in which the document is saved. Can be any WdSaveFormat constant. To save a document in another format, specify the appropriate value for the SaveFormat property of the FileConverter object.

LockComments
Object

true to lock the document for comments; otherwise false. The default is false.

Password
Object

A password string for opening the document.

AddToRecentFiles
Object

true to add the document to the list of recently used files on the File menu; otherwise, false. The default is true.

WritePassword
Object

A password string for saving changes to the document.

ReadOnlyRecommended
Object

true to have Microsoft Word suggest read-only status whenever the document is opened; otherwise, false. The default is false.

EmbedTrueTypeFonts
Object

true to save TrueType fonts with the document; otherwise, false. If omitted, the EmbedTrueTypeFonts parameter assumes the value of the EmbedTrueTypeFonts property.

SaveNativePictureFormat
Object

If graphics were imported from another platform (for example, Macintosh), true to save only the Microsoft Windows version of the imported graphics.

SaveFormsData
Object

true to save the data entered by a user in a form as a record; otherwise, false.

SaveAsAOCELetter
Object

If the document has an attached mailer, true to save the document as an AOCE letter (the mailer is saved).

Encoding
Object

The code page, or character set, to use for documents saved as encoded text files. The default is the system code page. You cannot use all MsoEncoding constants with this parameter.

InsertLineBreaks
Object

If the document is saved as a text file, true to insert line breaks at the end of each line of text.

AllowSubstitutions
Object

If the document is saved as a text file, true allows Word to replace some symbols with text that looks similar. For example, displaying the copyright symbol as (c). The default is false.

LineEnding
Object

The way Word marks the line and paragraph breaks in documents saved as text files. Can be one of the following WdLineEndingType constants: wdCRLF (default) or F:Microsoft.Office.Interop.Word.WdLineEndingType.wdCROnly.

AddBiDiMarks
Object

true adds control characters to the output file to preserve bi-directional layout of the text in the original document.

CompatibilityMode
Object

The compatibility mode that Word 2010 uses when opening the document. WdCompatibilityMode constant.

Applies to