Application.ImportFromText
Method: ImportFromText(pImportSettings as TextImportExportSettings,pElementList as ElementList) as Document
Description
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 Authentic Desktop.
Errors
1111 | The application object is no longer valid. |
1100 | Invalid parameter or invalid address for the return parameter was specified. |
1107 | Import from text file failed. |
1117 | Transformation to XML failed. |
Example
' ---------------------------------------------------------
' 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))
CheckForError