Datasheet

When you modify InfoPath forms, by setting values in design mode or by editing values in the form files
with a text editor, you are customizing the form declaratively. When you alter a form programmatically,
you are writing code using JScript or VBScript following the InfoPath Object Model.
As we’ve mentioned already, there are often two or three ways to achieve the results that you want.
Declarative Development
Declarative development involves modifying one or more XML files, including:
XML Schema that defines the structure of the form
XSLT files that define the views on a form
XML form definition file or manifest that specifies the overall structure of a form
Why might you want to use the declarative approach? Well, one reason might be that you prefer it to
programmatic development in certain cases, but there are times when InfoPath leaves you few options.
Here are just some occasions when declarative programming is either recommended or necessary:
Custom form merging
New menus and toolbars
Schema and other upgrade modifications
Custom transform templates
Adding processing instructions to XML data files
Exporting form data to custom Excel schemas
Creating custom task panes and their associated files
Programmatic Development
You can customize a form programmatically by writing scripting code to perform a variety of functions.
The main components that involve programmatic interaction are listed in the following table.
Component Description
Object model Type library composed of collections, objects, properties, methods, and events
that give you programmatic control of the environment.
Data validation XML schemas, expressions, and scripting code used to validate and constrain
the data that users are allowed to enter in a form.
Event handling Event handlers that respond to form loading, changes to content, view switch-
ing, and implement custom form submission.
User interface Customizable interface components including menus and toolbars with
related buttons, command bars, and a task pane.
Editing controls Controls that include collections, optional items, text lists, and fields.
5
About InfoPath
Table continued on following page
01 557130 Ch01.qxd 3/18/04 3:59 PM Page 5