NOTE: This is not a duplicate because I am asking about signing code, not the document body.
On a regular basis we need to update the certificates used to sign the code in a whole pile of Microsoft Word documents. This could be in conjunction with updating the VBA code itself.
To be clear, I want to sign the code/macros in the document so they can run. My intention is not to sign the document body. See: http://support.microsoft.com/kb/920627, for the difference.
We have built a utility using C# that allows us to update the VBA code, references and many other aspects of these templates but we have never found a good way to update the certificate.
Our code has access to the following name spaces.
using Microsoft.Office.Interop.Word
using Microsoft.Vbe.Interop;
using Microsoft.Office.Core;
Our current solution using SendKeys is fragile and just plain unacceptable.