DocumentBase.CurrentRsid 屬性

取得 Microsoft Office Word 指派至文件中之變更的亂數。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)

語法

'宣告
Public ReadOnly Property CurrentRsid As Integer
    Get
public int CurrentRsid { get; }

屬性值

型別:System.Int32
Microsoft Office Word 指派至文件中之變更的亂數。

備註

如果 Options 屬性的 StoreRSIDOnSave 屬性為 true,則每當儲存文件時,Word 就會產生亂數,以便應用程式用來加速比較和合併文件。 Word 會在資料表中儲存亂數,並在每次進行儲存之後更新該資料表。 CurrentRsid 屬性會傳回 Word 指派至文件的最後一個號碼。

範例

下列程式碼範例會顯示列出 CurrentRsid 屬性值的訊息方塊。 這個程式碼接著會將文字加入至第一個段落,儲存該文件,然後顯示列出 CurrentRsid 屬性修改值的第二個訊息方塊。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

Private Sub GetDocumentCurrentRsid()
    MessageBox.Show("CurrentRsid value before saving changes: " _
                    + Me.CurrentRsid.ToString())
    Me.Paragraphs(1).Range.Text = "Inserting some text..."
    Me.Save()
    MessageBox.Show("CurrentRsid value after saving changes: " _
                    + Me.CurrentRsid.ToString())
End Sub
private void GetDocumentCurrentRsid()
{
    MessageBox.Show("CurrentRsid value before saving changes: " 
        + this.CurrentRsid.ToString());
    this.Paragraphs[1].Range.Text = "Inserting some text...";
    this.Save();
    MessageBox.Show("CurrentRsid value after saving changes: " 
        + this.CurrentRsid.ToString());
}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間