DoCmd.TransferText acExportDelim, , "Book", "C:\txtfiles\April.csv", True
1. You asked to export a .csv file NOT a .doc file.
2. Did you look at the reference Galzxiom provided?
Yes, I simply copied it and changed the table name. No file was transfered.
In the meanwhile I have found the following code and now it works
Dim trz As Integer
Dim strCSV As String
For trz = 1 To 511
Close #trz
Next trz
trz = FreeFile
Open "C:\Users\MyName\Documents\Book.csv" For Output Access Write As #trz
With CurrentDb.OpenRecordset("Book ")
Dim x As Integer
For x = 0 To .Fields.Count - 1
strCSV = strCSV & strColumnDelimiter & .Fields(x).Name & "; "
Next x
Print #trz, Mid(strCSV, Len(strColumnDelimiter) + 1)
Do Until .EOF
strCSV = ""
For x = 0 To .Fields.Count - 1
strCSV = strCSV & strColumnDelimiter & Nz(.Fields(x), "<NULL>") & "; "
Next x
Print #trz, Mid(strCSV, Len(strColumnDelimiter) + 1)
.MoveNext
Loop
End With
Close #trz
Thanks but it didn´t work with that even if I manualy export the table and save a export specification. I used a modified version of the Monoceros code and it worked greate
Is there a bug in Access? It seems many people are complaining about this.
The transfer text does not work as I get error 3441. Even if I create a transfer spec, the message then becomes Transfer Spec not found.
The data is pure text with no funny characters except ().
MyPathFileName is on another PC.