确定 Microsoft Office Word 能否将文档签入服务器。
命名空间: Microsoft.Office.Tools.Word
程序集: Microsoft.Office.Tools.Word.v4.0.Utilities(在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)
语法
声明
Public Function CanCheckin As Boolean
public bool CanCheckin()
返回值
类型:System.Boolean
如果 Microsoft Office 能够将文档签入服务器,则为 true;否则为 false。
备注
若要利用 Word 中内置的协作功能,必须将文档存储在 Microsoft SharePoint Portal Server 中。
示例
下面的代码示例使用 CanCheckin 方法来确定该文档是否已经存储在 Microsoft SharePoint Portal Server 上。如果该文档已经存储在服务器上,则此示例调用 CheckIn 方法以签入该文档,将所做的更改保存到服务器位置,然后提交该文档以供批准过程使用。若要使用此示例,请从文档级项目内的 ThisDocument 类中运行此示例。
Private Sub DocumentCheckIn()
If CanCheckin() = True Then
Me.CheckIn(True, "My updates.", True)
Else
MessageBox.Show("This document cannot be checked in")
End If
End Sub
private void DocumentCheckIn()
{
if (this.CanCheckin())
{
object comments = "My updates.";
this.CheckIn(true, ref comments, true);
}
else
{
MessageBox.Show("This document cannot be checked in");
}
}
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关更多信息,请参见通过部分受信任的代码使用库。