Select and add files from a document library as attachments to a form
In this InfoPath demo video you will see how you can use an InfoPath form to download a file from a SharePoint document library and add it as an attachment to the InfoPath form.
In recipe 94, you'll learn how to write C# code in InfoPath 2010 that can download a document from a SharePoint document library and add it as an attachment to an InfoPath form.
Get more solutions from InfoPath 2010 Cookbook 3 which is available on Amazon.com
Watch next video: Submit/retrieve an entire InfoPath form to/from SQL Server
InfoPath demo video transcript:
Here I'm in SharePoint 2010 where I've got this Documents SharePoint document library that contains documents which I would like to select and add to an InfoPath form.
I've already created and published an InfoPath form template to this SharePoint form library, so if I click Add document to add a new form, you'll see that as soon as the InfoPath form opens, it displays a list of all of the documents contained in the Documents SharePoint document library.
So now it's just a matter of selecting one of these files, and clicking Add File to pull that document down from the SharePoint document library and add it here as an attachment in the InfoPath form.
I can repeat the process for another file... and as you can see, it has been added here to the InfoPath form.
Related InfoPath Demo Videos:
- Submit/retrieve an entire InfoPath form to/from SQL Server
- Auto-number InfoPath forms in a SharePoint form library
- Use an InfoPath form and SharePoint Designer workflow to send an email with attachments
- Convert an InfoPath form to Word and PDF in SharePoint 2010
- Use an InfoPath form to add a recurring all day event to a SharePoint calendar
- Use an InfoPath form to perform CRUD actions on an Access table with Memo field
- Submit an InfoPath form to a web service and then retrieve return values
Copyright: This article may not be used on web sites (whether personal or otherwise), copied, disseminated, altered, printed, published, broadcasted, or reproduced in any way without an expressed written consent of S.Y.M. Wong-A-Ton. The techniques demonstrated in this article may be used within any Microsoft InfoPath project. This article is provided without any warranties. Copyright for this article is non-transferrable and remains with the author, S.Y.M. Wong-A-Ton.