VSTO 3.0 for Office 2007 Programming
上QQ阅读APP看书,第一时间看更新

InfoPath 2007 in Visual Studio

When Microsoft first released InfoPath, in 2003, the software had some serious limitations. There was no easy way to combine InfoPath with programming languages. As a result, there was no easy way to use a language to refine the functionality of a form that had been designed with InfoPath.

When Microsoft launched the Visual Studio 2005 edition, they also released a toolkit for InfoPath that allowed programmers to integrate Visual Studio and InfoPath, in order to create managed code solutions for Microsoft Office applications. Managed code is program code that executes under the supervision of a virtual environment. Programs in any language can be compiled either into managed code or unmanaged code. Here, the code built on a .NET framework is meant to be managed code.

The bottom line is that VSTO 3.0 is well-integrated with Visual Studio 2008. It provides .NET platform developers with tools for building applications that influence Microsoft Office InfoPath 2007 (and other Microsoft Office programs, such as Microsoft Excel 2007 and Microsoft Word 2007)—all in an environment that matches the development, deployment, and security of live .NET applications. Whenever you find that the features of the InfoPath form designer aren't robust enough to get the job done, you can write scripted or managed code to create your ideal InfoPath form. In Microsoft InfoPath, every control on a form must be bound to an element in the corresponding XML document.

Note

VSTO offers supporting tools that Office developers can use to build on top of Office applications as a platform.

Writing scripts for InfoPath is typically done in JavaScript, which unfortunately has a very limited set of features when you compare them with the functionality attainable with managed code such as C#. Managed code gives you many additional options, including creating plugins, more flexible form solutions, and much more.