Figure 1. Add Business Logic to a Prebuilt Class Stub.
The InfoPath 2003 Toolkit for Visual Studio .NET implements .NET in a variety of ways. For example, it adds a reference to the Microsoft.Office.Interop.InfoPath.SemiTrust namespace. It also provides a default namespace and class, and it supplies predefined thisApplication and thisXDocument Private variables to the FormCode.vb or FormCode.cs source files. Add event handlers from the InfoPath designer's Properties dialogs for buttons, fields, and groups. The designer's Tools | Programming menu adds handlers for the OnOpen, OnSwitchViews, OnContextChange, and OnSign events. Insert a handler for the OnSave event from the Form Options dialog's Open and Save tab.