DocumentBase.Final Property
Gets or sets a value that indicates whether the document is final.
Namespace: Microsoft.Office.Tools.Word
Assembly: Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)
Syntax
'Declaration
Public Property Final As Boolean
Get
Set
public bool Final { get; set; }
Property Value
Type: System.Boolean
true if the document is final; otherwise, false.
Remarks
If you set this property to true, Microsoft Office Word marks the document as final, notifies recipients (if any) that the document is final, and sets the document to read-only.
Examples
The following code example retrieves the Final property of the current document. If the document is not already final, the code shows a message that informs the user that the document is not final, and then sets the Final property to true. Word also displays a message before the document is marked final. If the document is already final, the code shows a message that informs the user that the document is already final. To use this example, run it from the ThisDocument class in a document-level project.
Private Sub SetDocumentToFinal()
If Me.Final = False Then
MessageBox.Show("The current document is not final. " + _
"Setting it to be final.")
Me.Final = True
Else
MessageBox.Show("The current document is final.")
End If
End Sub
private void SetDocumentToFinal()
{
if (this.Final == false)
{
MessageBox.Show("The current document is not final. Setting "
+ "it to be final.");
this.Final = true;
}
else
{
MessageBox.Show("The current document is final.");
}
}
.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.