Share via


InfoPath Solutions

Applies to

The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.

Project type

  • Form-template projects

  • Application-level projects

Microsoft Office version

  • InfoPath 2007

For more information, see Features Available by Application and Project Type.

Visual Studio Tools for Office provides project templates you can use to create solutions for Microsoft Office InfoPath 2007. You can use these solutions to automate InfoPath, extend InfoPath features, or customize the InfoPath user interface (UI).

You can use Visual Studio Tools for Office to create form templates and application-level add-ins for InfoPath 2007.

Form Templates

Form template solutions consist of an assembly that is associated with a specific form template. You can design the look of your InfoPath form template and write managed code to add customized business logic without leaving Visual Studio. You can write code using either the InfoPath 2003-compatible object model (members of the Microsoft.Office.Interop.InfoPath.SemiTrust namespace) or the new InfoPath 2007 managed code object model (members of the Microsoft.Office.InfoPath namespace).

For complete documentation about creating InfoPath form template solutions, see Developing InfoPath Managed Code Form Templates.

Application-Level Add-Ins

Application-level add-ins for InfoPath are similar to add-ins for other Microsoft Office applications. These types of solutions consist of an assembly that is loaded by the application. End users can have access to the functionality of this assembly no matter which form or form template is open. For more information about application-level add-ins, see Getting Started Programming Application-Level Add-Ins and Architecture of Application-Level Add-Ins.

Automating InfoPath by Using an Application-Level Add-In

To access the InfoPath object model from a Visual Studio Tools for Office add-in, use the Application field of the ThisAddIn class in your project. The Application field returns a Application object that represents the current instance of InfoPath. For more information, see Programming Application-Level Add-Ins.

When you call into the InfoPath object model from an add-in, you use types that are provided in the primary interop assembly for InfoPath. The primary interop assembly acts as a bridge between the managed code in the Visual Studio Tools for Office add-in and the COM object model in InfoPath. All types in the InfoPath primary interop assembly are defined in the Microsoft.Office.Interop.InfoPath namespace. For more information about the InfoPath primary interop assembly, see About the Microsoft Office InfoPath Primary Interop Assembly. For more information about primary interop assemblies in general, see Office Solutions Development Overview and Office Primary Interop Assemblies.

Customizing the User Interface of InfoPath by Using an Add-In

When you create an add-in for InfoPath, you have several different UI customization options. The following table lists some of these options.

Task

For more information

Create a custom task pane.

Custom Task Panes Overview

Add custom toolbars and toolbar items.

How to: Create Office Toolbars Programmatically

Add menus and menu items.

How to: Create Office Menus Programmatically

For more information about customizing the UI of InfoPath and other Microsoft Office applications, see Office UI Customization.

See Also

Tasks

How to: Create Visual Studio Tools for Office Projects

Concepts

Getting Started Programming Application-Level Add-Ins

Office Solutions Development Overview

Architecture of Application-Level Add-Ins

Programming Application-Level Add-Ins

Writing Code in Office Solutions

Office UI Customization

Reference

Office Primary Interop Assemblies

Other Resources

Welcome to the InfoPath Developer Reference for Managed Code