Snapshooting a form and save as file attachment - InfoPath Dev
in

InfoPath Dev

Snapshooting a form and save as file attachment

Last post 05-22-2006 08:15 AM by Matt Faus. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 05-18-2006 12:21 AM

    Snapshooting a form and save as file attachment

    Hello,

    I created an InfoPath form with a base64 field on it. When clicking a button, I want the current form to be stored in that field (thus the form being stored in itself, a kind of snapshot).

    Which XPath (or vbScript) expression do I have to use (like "field1 = document.this"?)?
  • 05-19-2006 12:49 PM In reply to

    Re: Snapshooting a form and save as file attachment

    What kind of a snapshot are you looking for?

    Visual: that occurs when users sign the form... a graphical snapshot is created.

    XML: You will likely need to do the base64 conversion yourself in code, and you'd get what you want by getting XDocument.DOM.xml
  • 05-22-2006 12:11 AM In reply to

    Re: Snapshooting a form and save as file attachment

    Hello Greg,

    thanks for your answer!

    If you take the "Send as E-Mail"-function/data connection for example. There you have the possibility to send the current form as an attachment (*.xml). This file is exactly what I need.

    By clicking a button, I want the form to be stored in a base64 field, being identical to the one sent as an mail-attachment.

    Hope I made myself clear ;)

    Thanks in advance
  • 05-22-2006 08:15 AM In reply to

    Re: Snapshooting a form and save as file attachment

    Yes, you should be able to do this by using the method Greg described. I hope you are using managed code, because that will make things easier.

    string myxml = thisXDocument.DOM.xml;
    string myxml_base64 = base64Encode( myxml );

    The base64Encode method can be found here:http://www.vbforums.com/showthread.php?s=&threadid=287324

    If you are using JScript or VBScript you'll need to scour the internet for some base64 methods that other people have written. Or maybe write one yourself. But if you do this, please share!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.