DocumentBase.CheckIn(Boolean, Object, Boolean) 方法

定義

從本機電腦取得伺服器的文件,並將本機文件設為唯讀,使它不能在本機進行編輯。

public void CheckIn (bool saveChanges, ref object comments, bool makePublic);
member this.CheckIn : bool * obj * bool -> unit
Public Sub CheckIn (Optional saveChanges As Boolean, Optional ByRef comments As Object, Optional makePublic As Boolean)

參數

saveChanges
Boolean

true 表示將文件儲存至伺服器位置。 預設為 true

comments
Object

只有在 設定true為) 時,才會套用 SaveChanges (簽入檔修訂的批注。

makePublic
Boolean

true 表示允許使用者在簽入文件之後予以發行。

範例

下列程式代碼範例會CanCheckin使用 方法來判斷檔是否已儲存在 Microsoft SharePoint Portal Server 上。 如果檔已儲存在伺服器上,則範例會呼叫 CheckIn 方法來存回檔、將變更儲存至伺服器位置,以及提交檔以進行核准程式。 若要使用此範例,請從文件層級專案中的 ThisDocument 類別執行它。

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");
    }
}
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

備註

makePublic將 參數設定為true提交檔以進行核准程式,最終會導致檔版本發佈給具有檔唯讀許可權的使用者, (只有在 設為 true) 時才saveChanges適用。

若要利用 Word 內建的共同作業功能,必須將文件儲存在 Microsoft SharePoint Portal Server 上。

選擇性參數

如需選擇性參數的資訊,請參閱 Office 方案中的選擇性參數

適用於