Visual Studio Tools for Office: Using Visual Basic 2005 with Excel, Word, Outlook, and InfoPath

This chapter introduced InfoPath development with VSTO. You learned how to create a new VSTO InfoPath project based on a new form or an existing form. The chapter also covered key objects that you will code against, including InfoPath's Application object, the XDocument object (which represents a form), the View object, and objects passed as parameters to events such as the DataDOMEvent object.

This chapter also examined the InfoPath security model. You learned how a form is granted a particular security level, such as restricted, domain, or full trust. The chapter also covered InfoPath's data model and key data events such as OnBeforeChange, OnValidate, and OnAfterChange. You also read about the InfoPath's form object model and how to handle key events, including OnLoad, a button-click handler, OnContextChange, and OnSubmitRequest.

As you no doubt discovered while working through the examples in this chapter, InfoPath development differs quite a bit from the Excel, Word, and Outlook development experience. Whenever you add an event handler, you must do so using the menus and commands in InfoPath; you never use Visual Studio to add an event handler. Event handlers do not follow the traditional declarative Visual Basic 2005 event model of using WithEvents and Handles. Instead, methods that will handle InfoPath events are attributed. These attributes are somewhat difficult to create and edit, hence the need to have the InfoPath menus and dialog boxes generate these handlers for you. Finally, InfoPath development differs from development in Excel and Outlook because the design view of an InfoPath form is the InfoPath application window, not a designer that shows up in place within Visual Studio.

This book does not cover InfoPath in any additional detail. For more information on InfoPath programming, consult the MSDN page for InfoPath at http://msdn.microsoft.com/library/en-us/odc_2003_ta/html/odc_ancInfo.asp.

Категории