Compartir a través de


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
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

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace