DocumentBase.Close(Object, Object, Object) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
关闭文档。
public void Close (ref object saveChanges, ref object originalFormat, ref object routeDocument);
参数
- saveChanges
- Object
指定文档的保存操作。 可以是下列 WdSaveOptions 值之一:wdDoNotSaveChanges、wdPromptToSaveChanges 或 wdSaveChanges。
- originalFormat
- Object
指定文档的保存格式。 可以是下列 WdOriginalFormat 值之一:wdOriginalDocumentFormat、wdPromptUser 或 wdWordDocument。
- routeDocument
- Object
如果为 true,则将文档传送给下一个收件人。 如果没有为文档附加传送名单,则忽略此参数。
示例
下面的代码示例使用 Close 方法关闭文档,并提示用户将更改保存为 Word (.doc)文件。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。
private void DocumentClose()
{
object saveChanges = Word.WdSaveOptions.wdPromptToSaveChanges;
object originalFormat = Word.WdOriginalFormat.wdWordDocument;
object routeDocument = true;
this.Close(ref saveChanges, ref originalFormat, ref routeDocument);
}
Private Sub DocumentClose()
Me.Close(Word.WdSaveOptions.wdPromptToSaveChanges, _
Word.WdOriginalFormat.wdWordDocument, True)
End Sub
注解
可选参数
有关可选参数的信息,请参阅Office 解决方案中的可选参数。