|
Programmer's Reference >
WordApplication API >
DataImportProperties
The DataImportProperties Object
This class is used to control settings for importing data into a table or table cell. To create a DataImportProperties object, use Document.CreateDataImportProperties(). To actually import data, use Element.ImportData() and pass in a DataImportProperties object along with the data to import.
Examples:
[csharp]
WordApplication app = new WordApplication();
Document doc = app.Create();
DataImportProperties importProps = doc.CreateDataImportProperties();
// Set a few properties
importProps.UseColumnNames = true;
importProps.AutoFit = true;
// Import data into a new table and apply the DataImportProperties
Table dataImportTable = oTable.ImportData(oDataTable, importProps);
[vbnet]
Dim app As New WordApplication()
Dim doc As Document = app.Create()
Dim importProps As DataImportProperties = doc.CreateDataImportProperties()
' Set a few properties
importProps.UseColumnNames = True
importProps.AutoFit = True
' Import data into a new table and apply the DataImportProperties
Table dataImportTable = oTable.ImportData(oDataTable, importProps)
DataImportProperties Properties
| Property |
Type |
Access |
Description |
| AutoFit |
boolean
|
read write |
Sets or returns a boolean representing whether or not the table that is automatically created for the imported data will automatically be sized to fit the data being imported
|
| AutoFormatter |
AutoFormatter
|
read write |
Sets or returns an AutoFormatter that specifies how the imported data should be formatted in the table.
|
| ColumnIndexFilter |
int[]
|
read write |
Sets or returns an array of column indexes specifying the columns to import
|
| ColumnNameFilter |
String[]
|
read write |
Sets or returns an array of columns names specifying the columns to import
|
| MaxColumns |
int
|
read write |
Sets or returns an int that represents the maximum number of columns to be imported
|
| MaxRows |
int
|
read write |
Returns or set an int that represents the maximum number of rows to be imported
|
| UseColumnNames |
boolean
|
read write |
Sets or returns a boolean that represents whether to use the column names from the data source when importing the data
|
This object does not have any methods defined.

Copyright 2007 © SoftArtisans, Inc. All Rights Reserved.
|