there is an explanation on the code:
Public Sub ExportAll()
    Dim strFolder As String
    strFolder = Application.CurrentProject.Path & "\"  'add the Backslash
    Dim obj As AccessObject, dbs As Object
    Set dbs = Application.CurrentData
    For Each obj In dbs.AllTables
        If Left(obj.Name, 4) <> "MSys" Then
            ' arnelgp
            '
            ' You cannot export the Linked textfile to the same folder
            ' since it will delete the Original textfile, therefore
            ' you will get the error.
            ' Just export it to a Subfolder (Text subfolder)
            '
            If InStr(1, DLookup("foreignName", "MsysObjects", "Name='" & obj.Name & "'") & "", "#") > 0 Then
                On Error Resume Next
                MkDir strFolder & "Text"
                On Error GoTo 0
                DoCmd.TransferText acExportDelim, , obj.Name, strFolder & "Text\" & obj.Name & ".csv", True
            Else
                DoCmd.TransferText acExportDelim, , obj.Name, strFolder & obj.Name & ".csv", True
            End If
        End If
    Next obj
End Sub