Document.CanCheckin Method (2007 System)
Determines whether Microsoft Office Word can check in the document to a server.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)
Syntax
'Declaration
Public Function CanCheckin As Boolean
'Usage
Dim instance As Document
Dim returnValue As Boolean
returnValue = instance.CanCheckin()
public bool CanCheckin()
public:
bool CanCheckin()
public function CanCheckin() : boolean
Return Value
Type: System.Boolean
true if Microsoft Office Word can check in the document to a server; otherwise, false.
Remarks
To take advantage of the collaboration features built into Word, documents must be stored on a Microsoft SharePoint Portal Server.
Examples
The following code example uses the CanCheckin method to determine whether the document has been stored on a Microsoft SharePoint Portal Server. If the document has been stored on a server, then the example calls the CheckIn method to check in the document, save changes to the server location, and submit the document for the approval process.
This example is for a document-level customization.
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 Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.