AddSignatureLine in Excel Addin C#

AddSignatureLine in Excel Addin C#

Signature:

Excel gives you feature to insert your signatures by created self or you can insert digital signatures issued by CA. In this article we will learn how to create custom signature in excel.

Prerequisites:

  • Visual Studio 2015 or above having Microsoft Office for Developer Tool installed
  • Create Excel Addin in C# code style (Visual Studio Tools for Office)
  • Create a ribbon designer and put button

Code example:

 private void btnAddSignature_Click(object sender, RibbonControlEventArgs e)
        {
            Globals.ThisAddIn.Application.ActiveWorkbook.Signatures.AddSignatureLine("{00000000-0000-0000-0000-000000000000}");
        }

When you run above code, the Excel gets launched click on any sheet at desired range and hit the “Signature” button on the ribbon it will bring a popup asking followings (most of them are optional)

All fields are self explanatory, Click OK button post furnishing the desired information and you will have output as following:

Further there is a boolean property “CanAddSignatureLine” which lets you know whether you can add signature of not.

Next : Add or Insert form controls in Excel C#

Leave a Reply

Your email address will not be published.