Method to remove signature - InfoPath Dev
in

InfoPath Dev

Method to remove signature

Last post 08-17-2012 09:57 AM by alexj. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 09-25-2006 07:41 AM

    • zaphi
    • Top 150 Contributor
    • Joined on 01-09-2006
    • Switzerland
    • Posts 82

    Method to remove signature

    Hi
    Does anybody know how to remove signatures by code (which method).
    Thanks.
    Philippe
    Infopath 2007/SP2
  • 09-25-2006 09:58 AM In reply to

    Re: Method to remove signature

    Hello Philippe,

    I know that there is a collection in the XDocument object called 'SignedDataBlocks'. Hopefully you can use this collection to remove one or more signatures by code.
    For more information regarding this issue, please have a look here:

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_tr/html/odc_INF_Lab_10.asp

    Maybe another source of interest could be the following...

    http://www.readol.net/books818/computer/Windows/Introducing.Microsoft.Office.InfoPath.2003/index.left.htm

    HTH,
    Karsten
  • 09-25-2006 10:41 AM In reply to

    Re: Method to remove signature

    Thanks Karsten for the help in the forum!
    We have a special prize for posters who reach 100 helpful posts. :)
    Patrick Halstead
    Project Manager at Qdabra
  • 09-25-2006 03:51 PM In reply to

    Re: Method to remove signature

    Hi Patrick,

    ... I´m just wonder how many prices have you got in the past but even so that I´m just at the beginning --- I´ll do my very best to score 100 ... ;-))

    Maybe it could be a nice christmas gift ;-))

    Thanks for the flowers
    Karsten
  • 09-25-2006 04:31 PM In reply to

    Re: Method to remove signature

    We have sent out a handful of "prizes" - Matt Faus, Abhishek, Thierry, VT_Asparagus, Anders, ... We have two prizes - one is a solar charger for your cell phone. It's pretty cool. Another prize is a bottle of wine from the famous Washington State producer (Quilceda Creek). We also will promote you to a moderator of the forum where you provide assistance.
    Patrick Halstead
    Project Manager at Qdabra
  • 09-25-2006 11:54 PM In reply to

    • zaphi
    • Top 150 Contributor
    • Joined on 01-09-2006
    • Switzerland
    • Posts 82

    Re: Method to remove signature

    Hello Karsten,
    I'm afraid the links you've mentionned above don't talk about removing signatures by code, but removing in the signature dialog box.
    I have allready spent a lot of time to search in internet. What I need is a method such as "XDocument.SignedDataBlocks(i).Signatures.Delete() .But these seems not to exist. I would be very interested, how the button "Remove" in the dialog box works.

    I hope anybody can help me.
    regards.
    Philippe
    Infopath 2007/SP2
  • 10-12-2006 02:28 AM In reply to

    • zaphi
    • Top 150 Contributor
    • Joined on 01-09-2006
    • Switzerland
    • Posts 82

    Re: Method to remove signature

    As I haven't become any other answer, I have decided to put a button, which opens the Digital Signatures Wizard and the user has to remove the signatures himself manually.
    Infopath 2007/SP2
  • 10-12-2006 02:21 PM In reply to

    Re: Method to remove signature

    Hi Zaphi,
    Thanks for replying again. Sorry for the delay here. We can definitely provide some code snippets. I'll ask someone on our team to do this over the weekend.
    Patrick Halstead
    Project Manager at Qdabra
  • 10-12-2006 08:48 PM In reply to

    Re: Method to remove signature

    Hi Zaphi,
    Here is the code that removes the signatures. Please let me know if you have any queries on this

    SignaturesCollection oSignaturesCollection = thisXDocument.SignedDataBlocks["Actions"];
    int iCountOfSignatures = oSignaturesCollection.Count;
    if(iCountOfSignatures <= 0)
    {
    return;
    }

    IXMLDOMNode oSignatureNode = oSignedDataBlock.Signatures[0].SignatureBlockXmlNode;
    if(null == oSignatureNode)
    {
    return;
    }
    oSignatureNode.parentNode.removeChild(oSignatureNode);
  • 10-13-2006 04:22 AM In reply to

    • zaphi
    • Top 150 Contributor
    • Joined on 01-09-2006
    • Switzerland
    • Posts 82

    Re: Method to remove signature

    Hi Agni,
    Thanks for your help. I just have a question: Can you give me the sample code in JScript?
    I have just a problem with the line:

    IXMLDOMNode oSignatureNode = oSignedDataBlock.Signatures[0].SignatureBlockXmlNode;

    Regards.
    Philippe
    Infopath 2007/SP2
  • 10-17-2006 02:01 AM In reply to

    • zaphi
    • Top 150 Contributor
    • Joined on 01-09-2006
    • Switzerland
    • Posts 82

    Re: Method to remove signature

    Hi,
    Can anybody help me to give me the code above in JScript.

    Thanks.
    Philippe
    Infopath 2007/SP2
  • 10-23-2006 01:49 PM In reply to

    Re: Method to remove signature

    try with
    var oSignatureNode = oSignedDataBlock.Signatures(0).SignatureBlockXmlNode;
    or
    var oSignatureNode = oSignedDataBlock.Signatures[0].SignatureBlockXmlNode;

  • 03-13-2008 03:44 PM In reply to

    • KoopLaFez
    • Not Ranked
      Male
    • Joined on 01-22-2008
    • San Diego, CA
    • Posts 21

    Re: Method to remove signature

    I know this is an old thread, but if anyone's interested, I got this code to work in JScript (Where bName is a string containing the name of the data block that contains the signature you want to delete):

    function removeSignature(bName){

               var oSignaturesCollection = XDocument.SignedDataBlocks[bName].Signatures;
               var iCountOfSignatures = oSignaturesCollection.Count;

               if(iCountOfSignatures <= 0)
                         return;

               var oSignatureNode = oSignaturesCollection(0).SignatureBlockXmlNode;

               if(null == oSignatureNode)
                         return;

               oSignatureNode.parentNode.removeChild(oSignatureNode); 

    }
     

    The only hitch is that when you delete the signature block, the little "Click here to sign" text doesn't reappear until you reopen the form.  For my purposes this is fine becuase I'm clearing the signature before I submit the form to someone else via email, but if someone needed to clear the signature field, then have someone sign that field, this could be a problem.

  • 08-17-2012 09:57 AM In reply to

    • alexj
    • Not Ranked
    • Joined on 07-05-2012
    • Posts 18

    Re: Method to remove signature

    This is awesome, I so want to be able to do this on my form! (The form requires that a supervisor, service chief, and senior executive sign it in sequence.  The service chief and senior executive both need to be able to send back the form and remove the prior digital signatures to start it all over)

     Could anyone give me this in VBA please?

     Also, how do I find 'bname' for the code from my form?

     Since this is creating a function, I need to create a button which should call the function and pass bname to it?

Page 1 of 1 (14 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.