none
Programatically add image to signature in Word, using interop object model RRS feed

  • Question

  • Hello,

    I have a word document as a template, which consist of the signature control, i need to implement, sign the document using the image of the user signature and place it into the signature control. user will not open or add the signature from word, this it to be via a code. 

    I am looking for a way to do this using Word Interop object model , any Hint or link

    this is what i tried, but no help, 

     Microsoft.Office.Interop.Word.Document nativeDocument = Globals.ThisAddIn.Application.ActiveDocument;
                    Core.SignatureSet signatureSet1 = nativeDocument.Signatures;
                    Microsoft.Office.Core.Signature signt = signatureSet1.Add();

    regards Vimal

    Friday, July 25, 2014 7:57 PM

Answers

  • Hi Singhal,

    >>user will not open or add the signature from word, this it to be via a code. <<

    According to my investigation, I'm afraid it is impossible at present.

    To add a signature, there are two ways:

    1. in-document signature line

    Insert Tab -> Signature line.

    Related code:

    Worddocument.Signatures.AddSignatureLine

    Or SignatureSet.AddSignatureLine Method

    2. a digital signature

    File -> Info -> Protect Document -> Add a digital signature

    Related code:

    WordDocument.Signatures.AddNonVisibleSignature();

    Or SignatureSet.AddNonVisibleSignature Method (Office).

    Unfortunately, there will be a window blocks code if you create a signature via code. Users need to input information in this window. This is by design.

    I would suggest you submit feedback here.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, July 28, 2014 7:50 AM
    Moderator

All replies

  • Did try to use the Macro Recorder available in Word for generating the code automatically and then see what property or method calls are required?
    Friday, July 25, 2014 8:30 PM
  • Thanks for the quick reply,

    but in the macro recording, i can't record signing of the document. So any other way i can add signature on behalf of the user to the docx using word interop object model

    thanks


    regards Vimal

    Friday, July 25, 2014 9:55 PM
  • Hi Singhal,

    >>user will not open or add the signature from word, this it to be via a code. <<

    According to my investigation, I'm afraid it is impossible at present.

    To add a signature, there are two ways:

    1. in-document signature line

    Insert Tab -> Signature line.

    Related code:

    Worddocument.Signatures.AddSignatureLine

    Or SignatureSet.AddSignatureLine Method

    2. a digital signature

    File -> Info -> Protect Document -> Add a digital signature

    Related code:

    WordDocument.Signatures.AddNonVisibleSignature();

    Or SignatureSet.AddNonVisibleSignature Method (Office).

    Unfortunately, there will be a window blocks code if you create a signature via code. Users need to input information in this window. This is by design.

    I would suggest you submit feedback here.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, July 28, 2014 7:50 AM
    Moderator