locked
Programatically Add Digital Signature. RRS feed

  • Question

  • Hi ..
       i need to insert digital signature programattically[ to word,excel , autocad etc]. For word doucment ,
     
                moWordApp  =  Marshal.GetActiveObject("Word.Application");
                moActiveDoc =  moWordApp.GetType().InvokeMember("ActiveDocument",
                                        BindingFlags.GetProperty, null, moWordApp, null);
                oDocs = moActiveDoc.GetType().InvokeMember("Signatures",
                                        BindingFlags.GetProperty, null, moActiveDoc, null);

                object item = oDocs.GetType().InvokeMember("Add",
                                        BindingFlags.InvokeMethod, null, oDocs, null);

     i tryd this...But this will help only to open add signature window in the word file[then i can add the signature]. But my intention is to add signature without any user interaction.
    That is.. When user click a button, if a signature is available in the system, it will automatically insert to the document..
    please help me to solve the issue..If you have any sample code to solve this issue. please send that.

    Regards
    Dominic

    • Moved by Cindy Meister MVP Monday, August 10, 2009 1:21 PM not about VSTO technology (From:Visual Studio Tools for Office)
    Monday, August 10, 2009 10:21 AM

Answers

  • Hi Dominic

    As your question is not about the VSTO technology, it is off-topic in the VSTO forum. The forum's Please Read First message provides information about what VSTO is, as well as links to venues for non-VSTO, Office-related questions.

    FWIW there is no facility within the Office applications for digitally signing documents. This is for a reason: digitally signing a document is a security measure. If it could be done programmatically, that would negate the importance of the action. What's more, "malware" (such as viruses) could use the capability to propagate themselves.

    Office documents must be digitally signed manually.
    Cindy Meister, VSTO/Word MVP
    Monday, August 10, 2009 1:20 PM

All replies

  • Hi Dominic

    As your question is not about the VSTO technology, it is off-topic in the VSTO forum. The forum's Please Read First message provides information about what VSTO is, as well as links to venues for non-VSTO, Office-related questions.

    FWIW there is no facility within the Office applications for digitally signing documents. This is for a reason: digitally signing a document is a security measure. If it could be done programmatically, that would negate the importance of the action. What's more, "malware" (such as viruses) could use the capability to propagate themselves.

    Office documents must be digitally signed manually.
    Cindy Meister, VSTO/Word MVP
    Monday, August 10, 2009 1:20 PM
  • Hi Cindy Meister,

           Thank you for your precious time. I thought its office related question. so i posted here. In future i will post this in right forum.
    Thank you once again for your reply.

    Regards
    Dominic

           
    Monday, August 10, 2009 1:44 PM