Partager via


WorkbookBase.Signatures Property

Gets the collection of digital signatures for the workbook.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

Syntax

'Declaration
Public ReadOnly Property Signatures As SignatureSet
public SignatureSet Signatures { get; }

Property Value

Type: Microsoft.Office.Core.SignatureSet
A Microsoft.Office.Core.SignatureSet collection that contains the digital signatures for the workbook.

Remarks

To digitally sign Excel workbooks and verify other signatures in them, you need the Microsoft CryptoAPI and a unique digital signature certificate. The CryptoAPI is installed with Microsoft Internet Explorer 4.01 or later. You can obtain a digital signature certificate from a certification authority.

Examples

The following code example gets the number of signatures that are attached to the current workbook and displays an appropriate message to the user.

This example is for a document-level customization.

Private Sub GetSignatures()
    If Me.Signatures.Count = 0 Then
        MessageBox.Show( _
            "There are no signatures that are attached to the " _
            + "current workbook.")
    Else
        MessageBox.Show( _
            "Number of signatures attached to the current workbook: " _
            + Me.Signatures.Count.ToString())
    End If 
End Sub
private void GetSignatures()
{
    if (this.Signatures.Count == 0)
    {
        MessageBox.Show(
            "There are no signatures that are attached to the " 
            + "current workbook.");
    }
    else
    {
        MessageBox.Show(
            "Number of signatures attached to the current workbook: "
            + this.Signatures.Count.ToString());
    }
}

.NET Framework Security

See Also

Reference

WorkbookBase Class

Microsoft.Office.Tools.Excel Namespace