Villeroy's solution is not as painful as it might look on first sight. At least on my Apache OpenOffice 3.4.1 the Delimiter defaults to the one that was chosen the last time (if you don't close OpenOffice in the meanwhile). As far as I remember it should be like that since 3.3, because in that version the ASCII Import/Export filter has been improved in many ways.
Still if you think a macro can speed this up some more you can follow the way that is described in the Macro Wiki
- Code: Select all Expand viewCollapse view
sUrl = "file:///path/to/your/filename.txt"
FileProperties(0).Name = "FilterName"
' "Text CSV" is displayed in the SaveAs Dialog, but the Macro Recorder uses:
FileProperties(0).Value = "Text - txt - csv (StarCalc)"
FileProperties(1).Name = "FilterOptions"
' The first columns are Ascii Values of the separator and the Text Delimiter
' We don't need a text delimiter, so we set it to zero (34 would be the double qoute)
FileProperties(1).Value = "9,0,ANSI,1,,0,false,true,false"
This code is not complete it is simply taken from what the Macro recorder has listed when doing the steps that you described. Read first the Wiki page that I have mentioned above and complete the macro based on what you find ther. (The 2 commas without anything in between are not a typo, that's how it came out from the macro recorder). Either the 0
or the one of the false
are responsible for saving the cells not
as shown. If you really need to know exactly, you can record different constellations with the macro recorder by yourself. The code of the macro recorder is low quality, but at least in this case it gives you some hints what to use in the obscure PropertyValue
OpenOffice 3.1.1 (2.4.3 until October 2009) and LibreOffice 3.3.2 on Windows 2000, AOO 3.4.1 on Windows 7
There are several macro languages in OOo, but none of them is called Visual Basic or VB(A)! Please call it OOo Basic, Star Basic or simply Basic.