Use Visual Studio to create InfoPath forms… without code
Although the primary purpose of Visual Studio 2005 Tools for Office (InfoPath 2007 Support) is to add C# and Visual Basic code to your InfoPath form template, you can still take advantage of hosting InfoPath inside Visual Studio to design forms that don't have any code.
When you create a new InfoPath form template project in Visual Studio, by default, it will be created with code enabled. To obtain a form without code, you need to explicitly remove the code from the form by using the remove code button in the programming tab of the form options dialog.
After clicking on this button, you might be confused to see that the code file is still present in the project. Don’t worry about this. When you build the project, the hosted designer will not add the output assemblies to the form template.
How it works
After a new project is created, the “enabled” attribute of the “managedCode” element in the manifest.xsf defaults to “yes”. Clicking the remove code button sets this attribute to “no”.
<xsf2:managedCode … enabled="no"></xsf2:managedCode>
This attribute is set back to “yes” when you insert an event handler using the hosted InfoPath designer.
After a success build, the output assemblies will only be included with the form template when this attribute is set to yes.
- Gary
Software Development Engineer
Comments
Anonymous
May 29, 2006
The comment has been removedAnonymous
June 07, 2006
Visual Source Safe 2005 integration between InfoPath 2007 project created in VS2005 fails.
InfoPath Form Template folder which contains files that are used inside XSN template would not go under source control.
Check in fails for both folder and files under that folder.
This would happen even with new solution created from XSD schema.
Any ideas why would source control fail?
Appreciate all the help I can get.Anonymous
June 07, 2006
Please close the InfoPath Designer tab, before trying to check in your solution. Also make sure that you check out the solution before you build and run it.
- Frank
Software Development Engineer in TestAnonymous
February 19, 2007
Is it possible to show, edit etc. InfoPath forms, without installed InfoPath on a machine? I try to create an application, that show InfoPath forms for editing etc., but with some extra work before (Login and such things). Thank you. MichaelAnonymous
February 19, 2007
To mbruenjes: yes, editing InfoPath forms is possible by using a compatible browser, if you have Office Forms Services (part of MOSS 2007). You'd likely need to use the XmlFormView control as a part of your ASP.NET application. -AlexAnonymous
February 19, 2007
Thanks for your answer. Is there another solution for desktop applications only? MichaelAnonymous
February 19, 2007
Michael, are you asking if there's a way to fill out InfoPath forms in a desktop application without InfoPath installed? If so, the answer is no. Could you talk a little bit about your scenario? You could embed InfoPath as a web form control into your custom desktop application, but this still requires an InfoPath license. -AlexAnonymous
February 19, 2007
Last year i worked on a desktop application for the public health. There were great dynamic forms with dependecies and such things and it should be XML as base of that forms. The data of the filled form are shown in a PDF file with XSLT and XSL:FO. I used myXAML for the forms and created that as UserControls with the VS editor but this was very slow and unhandy. I played with InfoPath and it was exactly what i need. Dynamic forms with code behind for business logic. The company's idea was to stay away from licenses in any kind, so i hoped i can create InfoPath forms and put them into a desktop application. MichaelAnonymous
February 20, 2007
Michael, I bet the company already has an Office license - and InfoPath is included in another, slightly more expensive Pro Plus (and above) SKU. If you really can't use the Forms Server in MOSS, this would be the only way out. -AlexAnonymous
November 07, 2008
PingBack from http://www.sharepointbuzz.com/2008/11/07/beginners-guide-to-sharepoint-2007-workflow-development-create-an-infopath-web-based-form/Anonymous
May 29, 2009
PingBack from http://paidsurveyshub.info/story.php?title=infopath-team-blog-use-visual-studio-to-create-infopath-forms