Microsoft Office Tutorials and References
In Depth Information
Form-level events
Name
Description
FormEvents_Save()
The event handler for the Save event, where
we should insert any pre-defined business logic
to determine whether all data has been entered
according to defined rules; if the data is determined
to be valid, this event handler performs a save; if
any invalid entries are found, the event handler
displays a message and cancels the save operation;
the Save event is activated only if the form template
has the Save Using Custom Code option set in the
Form Options dialog box; the Save event is bound
using the SaveEventHandler delegate
FormEvents_Sign()
Used to add additional data to a digital signature;
this event handler will run only in fully-trusted
form templates; the Sign event is bound using the
SignEventHandler delegate
FormEvents_Merge()
Returns properties and methods that can be used
during a Merge event to programmatically interact
with a form's essential XML document and to
determine merge properties, such as the number of
files being merged; the Merge event is bound using
the MergeEventHandler delegate
A delegate is a member of a group, which represents the same group.
A delegate is an object that refers to a static method or an instance of
a method.
To receive events when a form is processed, you need to first register the events.
You can use the InternalStartup method to add code to register the events. The
InternalStartup method is generated by the IDE. Events can be registered either
manually or using the IDE. For form-level events, the code displays the following:
// Note that the following procedure is required by Microsoft Office
InfoPath.
// It can be modified using Microsoft Office InfoPath.
public void InternalStartup()
{
EventManager.FormEvents.Loading += new
LoadingEventHandler(FormEvents_Loading);
}
 
Search JabSto ::




Custom Search