Microsoft Office Tutorials and References
In Depth Information
Form-level events
Form-level events
You can write code to react to different events that can occur in Microsoft Office
InfoPath 2007, as a user ills out a form. In InfoPath, events take the form of event
handlers that are created when you work with a form in design mode. InfoPath
event handlers must be initially created in design mode because, in addition to the
scripting declarations that are created in a form's primary scripting file, entries are
also made in the form definition ( .xsf ) file. After you have created an event handler,
you should not alter its declaration in the primary scripting file. The following table
describes how each form-level event behaves.
Name Description
FormEvents_Loading() Returns a reference to a form's essential XML
document and return status during the loading
of a form; the Loading event is bound using the
LoadingEventHandler delegate
FormEvents_ViewSwitched() Returns a reference to a form's essential XML
document during a switch view operation;
the ViewSwitched event is bound using the
ViewSwitchedEventHandler delegate
FormEvents_ContextChanged() Returns information about the XML Document
Object Model DOM ) node that is the current (
context of the form's essential XML document;
the ContextChanged event is bound using the
ContextChangedEventHandler delegate
FormEvents_Submit() Used to prevent the form from being submitted
if the form has not been saved first; the Submit
event is activated only if the form template has the
Perform Custom Action Using Code option set
in the Submit Options dialog box; the Submit
event is bound using the SubmitEventHandler
FormEvents_VersionUpgrade() An event handler for the VersionUpgrade
event, which allows you to run the code to update
a form when the form template on which it is
based has been upgraded since the form was last
opened; the event handler is used to display the
version numbers of the form and form template;
the VersionUpgrade event is bound using the
VersionUpgradeEventHandler delegate
Search JabSto ::

Custom Search