Altova XMLSpy 2024 Enterprise Edition

Method: GetTextImportElementList(pImportSettings as TextImportExportSettings) as ElementList



GetTextImportElementList retrieves importing information about the text-file as specified in pImportSettings. The function returns a collection of ElementListItems where the properties ElementListItem.Name contain the names of the fields found in the file. The values of remaining properties are undefined.


If the text-file does not contain a column header, set pImportSettings.HeaderRow to false. The resulting element list will contain general column names like 'Field1' and so on.


See also Import and export of data.




The application object is no longer valid.


Invalid parameter or invalid address for the return parameter was specified.


Import from database failed.


Error during text element list import. Cannot create parser for import file.


Error during text element list import.




' ---------------------------------------------------------

' VBA client code fragment - import selected fields from text file

' ---------------------------------------------------------

 Dim objImpSettings As TextImportExportSettings

 Set objImpSettings = objSpy.GetTextImportExportSettings


 objImpSettings.ImportFile = "C:\ImportMe.txt"

 objImpSettings.HeaderRow = False


 Dim objList As ElementList

 Set objList = objSpy.GetTextImportElementList(objImpSettings)


 'exclude first column

 objList.RemoveItem 1


 Dim objImpDoc As Document

 On Error Resume Next

 Set objImpDoc = objSpy.ImportFromText(objImpSettings, objList)


© 2018-2024 Altova GmbH