Microsoft Office InfoPath 2007 Beta integration with VSTA

Got forms? For example, expense reports, travel requests, asset tracking forms, and status reports? Then take a look at InfoPath. As an XML-based Office application for creating and filling out electronic forms, InfoPath includes a design-mode for rapid-development and a client that includes Office features like spell-checking and rich formatting. InfoPath 2007 Beta also introduces support for filling out those same InfoPath forms in the browser, in Outlook, and on mobile devices, among other features.


Most forms use the built-in InfoPath feature-set for functionality like repeating and optional controls, data validation, web-service connections, rules and formulas for automated completion, and more. But for advanced enterprise-wide forms, some InfoPath developers want to write code for their custom needs. InfoPath 2007 Beta gives you just that. We’ve created a new managed object model (OM) that works the same way in the InfoPath client and in the browser, so you can write your code once no matter how the form is being filled out. And to make it easy to use that new OM, we’ve integrated with Visual Studio Tools for Applications.


InfoPath 2007 Beta’s integration with VSTA provides out-of-the-box managed code development. You can add events to any piece of data in the form, as well as capture other events such as the form opening, saving, or submitting. Adding an event from the InfoPath design mode will launch VSTA with the appropriate code-stub so you can write what you want using the InfoPath OM and System.Xml, complete with IntelliSense. When you’re done, you can set break points and debug your form’s code while running behind the InfoPath form, just as you’d expect.


Here are some common code tasks for InfoPath forms:

·         Look up the current user’s username (InfoPath has built-in active-directory “roles” support, but does not provide direct access to the current user’s username)

·         Reuse existing process libraries (for example, a mortgage quote algorithm already used in other applications)

·         Complex data connections and validation (InfoPath has built in support for Access, SQL, Web Services, SharePoint and email connections, and formulas and pattern matching for validation, but some forms simply require more)


Look for this integration it the Microsoft Office InfoPath 2007 Beta!


Ned Friend

Program Manager - InfoPath

Comments (1)

  1. If you need to write some Visual Basic or C# code behind your form, or maybe just some script, there…

Skip to main content