von Stephan » So, 15.08.2004 15:43
Aus:
http://api.openoffice.org/basic/man/tut ... torial.pdf
habe ich ein Beispiel entnommen und etwas modifiziert. Folgendes funktioniert bei mir für TAB-getrennte Werte:
Code: Alles auswählen
Sub import2_sample
Dim mFileProperties(1) As New com.sun.star.beans.PropertyValue
Dim sUrl As String
sUrl = "file:///D:/test.txt"
mFileProperties(0).Name = "FilterName"
mFileProperties(0).Value = "scalc: Text - txt - csv (StarCalc)"
mFileProperties(1).Name = "FilterFlags"
mFileProperties(1).Value = "9,34,SYSTEM,1,1/1/1/1/1/1/1/1"
oDesktop = createUNOService("com.sun.star.frame.Desktop")
oDocument = oDesktop.loadComponentFromURL(sUrl, "_blank", 0, mFileProperties())
End Sub
Du müßtest möglicherweise die Parameter in der Zeile:
Code: Alles auswählen
mFileProperties(1).Value = "9,34,SYSTEM,1,1/1/1/1/1/1/1/1"
anpassen. Informationen dazu stehen in dem Link Kapitel 4.2.1.
Gruß
Stephan
Aus:
http://api.openoffice.org/basic/man/tutorial/tutorial.pdf
habe ich ein Beispiel entnommen und etwas modifiziert. Folgendes funktioniert bei mir für TAB-getrennte Werte:
[code]Sub import2_sample
Dim mFileProperties(1) As New com.sun.star.beans.PropertyValue
Dim sUrl As String
sUrl = "file:///D:/test.txt"
mFileProperties(0).Name = "FilterName"
mFileProperties(0).Value = "scalc: Text - txt - csv (StarCalc)"
mFileProperties(1).Name = "FilterFlags"
mFileProperties(1).Value = "9,34,SYSTEM,1,1/1/1/1/1/1/1/1"
oDesktop = createUNOService("com.sun.star.frame.Desktop")
oDocument = oDesktop.loadComponentFromURL(sUrl, "_blank", 0, mFileProperties())
End Sub[/code]
Du müßtest möglicherweise die Parameter in der Zeile:
[code]mFileProperties(1).Value = "9,34,SYSTEM,1,1/1/1/1/1/1/1/1"[/code]
anpassen. Informationen dazu stehen in dem Link Kapitel 4.2.1.
Gruß
Stephan