I'm creating an Excel file *.xlsx
in a C#
environment with Microsoft Excel Interop.
I call the signing dialog programmatically with the following commands:
using Excel = Microsoft.Office.Interop.Excel;
Excel.Application xlapp = null;
xlapp = new Microsoft.Office.Interop.Excel.Application();
Excel.Workbook xlwb = xlapp.Workbooks.Add();
object sigID = "{00000000-0000-0000-0000-000000000000}";
xlwb.Signatures.AddNonVisibleSignature(sigID);
The "Sign" dialog appears and the user's credentials are generally displayed as they log on to the system with them. The user is prompted for "Purpose for signing this document".
I would like to predefine the purpose. (Users would still be able to edit it, if they have a differing purpose.) Am I overseeing something I should set in the xlwb.Signatures
or am I looking in the wrong place?
I think this should work:
All I'm doing above is turning off the alerts while you set the signature, and then turning them back on right after.