SaveAsEx 方法 (Visio)Document.SaveAsEx method (Visio)

使用传入参数中的额外信息将文档保存为具有指定文件名的文件。Saves a document with a file name using extra information passed in an argument.

语法Syntax

表达式SaveAsEx(FileName, SaveFlags)expression.SaveAsEx (FileName, SaveFlags)

_表达式_一个代表**Document** 对象的变量。expression A variable that represents a Document object.

参数Parameters

名称Name 必需/可选Required/Optional 数据类型Data type 说明Description
FileNameFileName 必需Required StringString 文档的文件名。The file name for the document.
SaveFlagsSaveFlags 必需Required IntegerInteger 如何保存文件。How to save the file.

返回值Return value

NothingNothing

注解Remarks

SaveAsEx 方法与 SaveAs 方法几乎完全一样,只是前者提供了一个额外的参数,调用方可以通过该参数指定如何保存文档。The SaveAsEx method is identical to the SaveAs method, except that it provides an extra argument in which the caller can specify how the document is to be saved.

_SaveFlags_参数应为以下值的组合。The SaveFlags argument should be a combination of the following values.

常量Constant Value 说明Description
visSaveAsROvisSaveAsRO &H1&H1 将文档另存为只读文件。The document is saved as read-only.
visSaveAsWSvisSaveAsWS &H2&H2 将当前工作区与文件一起保存。The current workspace is saved with the file.
visSaveAsListInMRUvisSaveAsListInMRU &H4&H4 文档将包含在最近使用 (MRU) 列表中。The document is included in the Most Recently Used (MRU) list. 默认情况下,SaveSaveAs 不会将文档放入 MRU 列表中。By default, Save and SaveAs do not place the document into the MRU list.

示例Example

此 Microsoft Visual Basic for Applications (VBA) 宏说明如何使用 SaveAsEx 方法。This Microsoft Visual Basic for Applications (VBA) macro shows how to use the SaveAsEx method. 运行此宏之前,请将 path 更改为要保存绘图的位置,并且将 filename 更改为要指定给文件的名称。Before running this macro, change path to the location where you want to save the drawing, and change filename to the name you'd like to assign the file.

 
Public Sub SaveAsEx_Example() 
 
 'Use the SaveAsEx method to save the drawing as a 
 'new read-only drawing. 
 ThisDocument.SaveAsEx "path\filename.vsd ", visSaveAsRO 
 
End Sub

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.