在签署办公文件时,是否可以通过编程方式预先定义目的? [英] Is there a way to programmatically predefine the purpose when signing an office document?

查看:84
本文介绍了在签署办公文件时,是否可以通过编程方式预先定义目的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Microsoft Excel Interop的 C#环境中创建Excel文件 *。xlsx

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

我想预先定义目的。 (如果用户有不同的用途,则用户仍然可以对其进行编辑。)我是否正在监视应该在 xlwb.Signatures 中设置的内容?

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?

推荐答案

我认为这应该可行:

xlapp.DisplayAlerts = false;
xlwb.Signatures.AddNonVisibleSignature(sigID);
xlapp.DisplayAlerts = true;

我在上面所做的就是在设置签名时关闭警报,然后将其关闭

All I'm doing above is turning off the alerts while you set the signature, and then turning them back on right after.

这篇关于在签署办公文件时,是否可以通过编程方式预先定义目的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆