Introduction to using InfoPath in a custom program

If your organization is developing a custom Microsoft Windows program or a custom Web form to collect data, you can integrate the features of the Microsoft Office InfoPath editor by using an InfoPath control in your custom program.

This article provides an overview of how you can extend and enhance your custom program or Web form by using one of the controls included with InfoPath and InfoPath Forms Services.

Note: To use an InfoPath control in a custom program or Web form, you will need to be familiar with using the Microsoft Component Object Model (COM), the Microsoft .NET framework, or ASP .NET controls in a custom program.

In this article

Overview

The InfoPath control

Overview

You can use InfoPath to create form templates that help your organization collect consistent and reusable data by using features such as conditional formatting, data validation, and data connections to Web services and databases. Your users can fill out forms that are based on your form templates on their computers, or in a Web browser if your Web server uses InfoPath Forms Services.

If your business requirements compel you to use a customized solution, you can take advantage of these features by using an InfoPath control in your custom program or Web form. For example, imagine the following situations:

  • Your company developed a custom Windows program that works with your company's database. Instead of creating a user interface from scratch to collect data for this database, you can save development time by using the InfoPath control as your data gathering interface. Your custom program will have all of the data gathering features of the InfoPath editor, and you will have the benefit of not having to develop your own interface.

  • You have a business requirement for a Web form than can accept and display engineering drawings in a specific format. Your users must submit these engineering drawings to apply for a building permit. To fulfill this business requirement, your development team has created a custom program that can accept these drawings through a Web form and display them in a Web browser. You need to connect your Web program to a SQL Server database to store the drawings submitted by your users. By extending your custom Web form with the InfoPath control, you can take advantage of InfoPath's native support for SQL Server databases without having to develop a new custom program that works with your company's existing Web form.

  • Your company uses an external data source that is not currently supported by any data gathering programs, including InfoPath. Because your company uses this external data source to store data, your development team has created a custom Windows program to communicate with this external data source. Adding the InfoPath control to your custom program provides a rich, user interface that includes all of InfoPath's features.

With InfoPath encapsulated in a control, you can now add the features of the InfoPath editor to your custom Windows program or custom Web form.

Top of Page

The InfoPath control

The InfoPath control is a compiled dynamic link library (.dll) file that exposes the features of the InfoPath editor to a custom Windows program or Web form. InfoPath and InfoPath Forms Services ship three different versions of the InfoPath control. The control that you use depends on the technology used in your custom program and whether that program will be used on computers with InfoPath or through a browser as a Web form.

Custom Windows program that uses COM    Use the Ipeditor.dll file that ships with InfoPath in your custom Windows applications that use COM. To use this control, create an instance of the InfoPathEditorObject class. This class becomes available by adding a reference to the Ipeditor.dll file in your custom program. Because you are using a file that ships with InfoPath, your users will need to have InfoPath installed on their computers to use your custom program.

Custom Windows program that uses the .NET framework    Use the Microsoft.Office.InfoPath.FormControl assembly that ships with InfoPath in your custom Windows program that uses the .NET framework. The MSDN article, Hosting the InfoPath 2007 Form Editing Environment in a Custom Windows Form Application, has more information and example code that uses this assembly. Because you are using a file that ships with InfoPath, your users will need to have InfoPath installed on their computers to use your custom program.

Custom Web form    Use the XmlFormView ASP.NET control that ships with InfoPath Forms Services in your custom Web form. The MSDN article, Hosting the InfoPath 2007 Form Editing Environment in a Custom Web Form, has more information and example code that uses this control. Because this control renders your custom Web form through a server running InfoPath Forms Services, your users only need a Web browser to use your custom Web form.

Top of Page

Share Facebook Facebook Twitter Twitter Email Email

Was this information helpful?

Great! Any other feedback?

How can we improve it?

Thank you for your feedback!

×