Udostępnij za pośrednictwem


Document.CurrentRsid Property (2007 System)

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

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v9.0 (in Microsoft.Office.Tools.Word.v9.0.dll)

Syntax

'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property CurrentRsid As Integer
'Usage
Dim instance As Document 
Dim value As Integer 

value = instance.CurrentRsid
[BrowsableAttribute(false)]
public int CurrentRsid { get; }
[BrowsableAttribute(false)]
public:
property int CurrentRsid {
    int get ();
}
public function get CurrentRsid () : int

Property Value

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

Remarks

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.

Examples

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.

This example is for a document-level customization.

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 Security

See Also

Reference

Document Class

Document Members

Microsoft.Office.Tools.Word Namespace