Altova XMLSpy 2024 Enterprise Edition

Method: ImportFromText(pImportSettings as TextImportExportSettings,pElementList as ElementList) as Document



ImportFromText imports the text file as specified in pImportSettings. The parameter pElementList can be used as import filter. Either pass the   list returned by a previous call to GetTextImportElementList or null to import all columns. To avoid import of unnecessary columns use ElementList.RemoveElement to remove the corresponding field names from pElementList before calling ImportFromText.

The method returns the newly created document containing the imported data. This document is the same as the active document of XMLSpy.


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 text file failed.


Transformation to XML failed.




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

' VBA client code fragment - import from text file

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

 Dim objImpSettings As TextImportExportSettings

 Set objImpSettings = objSpy.GetTextImportExportSettings


 objImpSettings.ImportFile = strFileName

 objImpSettings.HeaderRow = False


 Dim objImpDoc As Document

 On Error Resume Next

 Set objImpDoc = objSpy.ImportFromText(objImpSettings,                                                objSpy.GetTextImportElementList(objImpSettings))



© 2018-2024 Altova GmbH