Once you’ve mastered the basics of InfoPath and understand how it hangs together, you can come up with many cool solutions that can increase productivity of non-technical employees in your organization.
One such a solution is for example if you’ve got InfoPath forms stored in a SharePoint form library and these InfoPath forms contain documents stored in a File Attachment control on the form.
You could create a custom SharePoint Designer (SPD) activity that can be used as an action in a SharePoint Designer workflow that can be run on InfoPath forms to extact file attachments and upload them to a separate SharePoint document library.
While I’ve already previously written about such a solution, that solution dealt with using a workflow developed in Visual Studio to extract and upload InfoPath form attachments to SharePoint and the SharePoint document library to which files are uploaded was hardcoded in the workflow code.
While you could add flexibility to a Visual Studio workflow to pass the name of the SharePoint document library to the workflow using initiation forms, creating Visual Studio workflows for SharePoint is a complex process in itself.
A custom SPD action not only provides ease of use for the SharePoint end-user, but also less development effort for you as a programmer.
You can combine the information presented in the following two articles to put an InfoPath file extract solution using a custom SPD action together:
- Building Custom Activities for Use in SharePoint Designer 2007
- Use a custom SharePoint workflow to extract a file attachment from an InfoPath form and upload it to a SharePoint document library (Note: You’ll have to modify the code in step 8 slightly and add it to the Execute method of the custom SPD activity)
If you want to see what this solution looks like in action, I’ve put together a short demo showing you how you can extract InfoPath form attachments using a custom SharePoint Designer action. The code has already been published in the second article I mentioned above, but if you’re still struggling to put it together, let me know, and I’ll post the code I used for the demo.

Comments to this post were closed 30 days after it was published.