Microsoft InfoPath 2010
The official blog of the Microsoft InfoPath team

Use Visual Studio to create InfoPath forms… without code

Use Visual Studio to create InfoPath forms… without code

Rate This
  • Comments 11
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
Leave a Comment
  • Please add 3 and 6 and type the answer here:
  • Post
  • I have Visual Studio 2005 Team Edition for Developers installed which installed the Visual Studio Tools for Office, however i get an error when i try installing: "Visual Studio 2005 Tools for Office Update: InfoPath 2007 Beta Support" which is available at the following URL: http://www.microsoft.com/downloads/details.aspx?FamilyID=00779894-e95f-4b22-8590-07584c891207&DisplayLang=en

    I also have the Microsoft Infopath 2007 Beta 2 installed.

    The error message says: "Setup cannot detect atleast one required component: matching language version of Visual Studio 2005 Team System, Professional Edition, or Tools for the Microsoft Office System, including Visual Basic or Visual C#.

    I would like to be able to develop InfoPath 2007 forms inside Visual Studio 2005.

    Let me know.

    Thank you.

    Parag
  • 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.
  • 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 Test
  • 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.

    Michael

  • 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.

    -Alex

  • Thanks for your answer. Is there another solution for desktop applications only?

    Michael

  • 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.

    -Alex

  • 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.

    Michael

  • 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.

    -Alex

  • PingBack from http://www.sharepointbuzz.com/2008/11/07/beginners-guide-to-sharepoint-2007-workflow-development-create-an-infopath-web-based-form/

  • PingBack from http://paidsurveyshub.info/story.php?title=infopath-team-blog-use-visual-studio-to-create-infopath-forms

Page 1 of 1 (11 items)