Expand Minimize
This topic has not yet been rated - Rate this topic

DocumentBase.CurrentRsid Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets a random number that Microsoft Office Word assigns to changes in the document.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
public int CurrentRsid { get; }

Property Value

Type: System.Int32
A random number that Microsoft Office Word assigns to changes in the document.

If the StoreRSIDOnSave property of the Options property is true, each time a document is saved, Word generates a random number that the application uses to facilitate comparing and merging documents. Word stores the random numbers in a table and updates the table after each save. The CurrentRsid property returns the last number that Word assigned to the document.

The following code example shows a message box that displays the value of the CurrentRsid property. The code then adds text to the first paragraph, saves the document, and then shows a second message box that displays the modified value of the CurrentRsid property. To use this example, run it from the ThisDocument class in a document-level project.

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());
}
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.