Microsoft Office Tutorials and References
In Depth Information
Understanding the InfoPath object model functional area
Application
The base of the InfoPath 2007 object model is the Application class. The
Application class includes properties and methods that return references to the
high-level objects of the InfoPath object model. The Application object in the
InfoPath object model provides a number of properties and methods that can be
used not only to access lower-level collections and objects in the object model, but
also to perform a variety of extended-use functions.
// Accessing the User property of the Application class and reading
the logged in Username
this.Application.User.UserName.ToString();
WindowCollection
WindowCollection contains a Window object for each window within a Microsoft
Office InfoPath 2007 form. The Windowcollection implements properties that can
be used to access a form's associated Window objects. It is accessible through the
Windows property of the Application object. WindowCollection members have
two core properties— count and item , which handle the property called Windows
from the Windows collection. The WindowCollection collection can be used only
to get the number of Window objects that the collection contains.
// Reference to the InfoPath WindowCollection and accessing the
Application window
Microsoft.Office.InfoPath.WindowCollection
InfoPathWindowCollection = this.Application.Windows;
// Reading the count of InfoPath windows
InfoPathWindowCollection.Count.ToString();
Window
The Window objects of an InfoPath form are accessed all the way through the Item
property of the WindowCollection object. The Application class has a property for
enumerating windows, which is a collection of Window objects. The Window object
provides a number of properties and methods that can be used to programmatically
interact with InfoPath windows. You can also access the view by using the windows'
object properties. Views are an essential part of InfoPath forms.
 
Search JabSto ::




Custom Search