|InfoPath Developer Reference|
Version Added: InfoPath 2007
expression An expression that returns an IInfoPathDataImporter interface.
|pPrintSettings||Required||IPropertyBag||A collection of print settings.|
|punkViewControls||Required||[IENUMUNKNOWN]||An mshtml.IEnumUnknown collection of controls in the view.|
The following print settings are available through the IPropertyBag interface.
|PageSize||The current page size, such as A4, B4, Letter.|
|TopMargin||The top margin of the current view.|
|BottomMargin||The bottom margin of the current view.|
|LeftMargin||The left margin of the current view.|
|RightMargin||The right margin of the current view.|
|MarginUnitsType||The margin measurement units.|
This object or member is used for extending the InfoPath application and is not intended to be used directly from your form code.
For more information about programmatically importing data into an InfoPath form, see the InfoPath Developer Portal on the Microsoft Office Developer Center.
In the following example, the Import method of the IInfoPathDataImporter interface is used to iterate through the mshtml.IEnumUnknown collection of IInfoPathViewControl controls in the view of the active form.
The Import routine is the main part of a solution used to build a custom data importer. The Visual Studio project requires a reference to the Microsoft Office InfoPath 2.0 Type Library and System.Windows.Forms, with Imports statements for each as well as mshtml. Implements statements are required to generate the signatures for the methods provided by the custom data importer interfaces, including IInfoPathDataImporter, IInfoPathDataImporterFields, IInfoPathViewControl, and IPropertyBag.
|To build a custom data importer using a .NET class library, check the Register for COM interop check box on the Compile tab of the class properties editor.|
|To debug a custom data importer, set a Start Action in Visual Studio to Start an external program, and browse to INFOPATH.EXE located at <drive>:\Program Files\Microsoft Office\Office12\. This option is available on the Debug tab of the class properties editor.|