Hallo zusammen.
Ich habe hier ein Script (Agent) mit dem ich eine Notes View nach Symphony Calc exportiere.
Diese Script funktioniert unter dem Windows Betriebssystem mit Lotus Notes 8.5.2 einwandfrei.
Wenn ich es allerdings unter einem Linux Betriebssystem (Ubuntu) mit Lotus Notes 8.5.2 laufen lasse bekomme ich
die Meldung : " Diese Funktion wird nicht unterstützt "
Kann mir jemand einen Tip geben wo ich etwas Ändern muss oder wo ich Informationen bekomme oder Nachlesen kann.
Hier das Script.
Class OOProperties
'Call cell.setString(Format(colval, "0"))
Private vProp() As Variant
Private app As Variant
Private vStruct As Variant
Private bInz As Integer
Sub new()
Set App = createobject("com.sun.star.ServiceManager")
Set vStruct = App.Bridge_GetStruct("com.sun.star.beans.PropertyValue")
End Sub
Sub addProperty(sName As String, vValue As Variant)
If bInz Then
Redim Preserve vProp(Ubound(vProp) + 1)
Else
Redim vProp(0)
End If
bInz = True
vStruct.Name = sName
vStruct.Value = vValue
Set vProp(Ubound(vProp)) = vStruct
End Sub
Property Get Values()
If Not bInz Then
Me.addProperty "Dummy!", 0
bInz = True
End If
Values = vProp
End Property
End Class
Sub Initialize
Dim session As New NotesSession
Dim ws As New NotesUIWorkspace
Dim fileOo As String
Dim fileOoA As String
Dim args() As Variant
Dim prop As New OOProperties
Dim App As Variant
Dim objCoreReflection As Variant
Dim objDesktop As Variant
Dim objDocument As Variant
Dim objSheet As Variant
Dim cell As Variant
Dim db As notesdatabase
Set db = ws.CurrentDatabase.Database
Dim view As NotesView 'The notes view that contains the data to export
Set view = db.GetView("TestView")
Dim doc As NotesDocument 'A notes document that contains data to be exported
Set doc = view.GetFirstDocument
'Remember that Openoffice uses / not \ you might have to convert your filepath.
fileOo = "C:/Notes/Data/Testfile.xxx.ods"
fileOoA = "C:/Temp/Testfile 2011.xxx.ods"
'Create objects that are required to work with openoffice
Set App = createobject("com.sun.star.ServiceManager") 'The servicemanager
Set objCoreReflection= App.createInstance("com.sun.star.reflection.CoreReflection")
Set objDesktop = App.createInstance("com.sun.star.frame.Desktop") 'The main desktop object
prop.addProperty "Hidden", True 'Decide to run Openoffice hidden in background or visible to the user
Set objDocument = objDesktop.loadComponentFromURL("file:///"+fileOo,"_blank", 0, prop.Values) 'Load the file
Set objSheet = objDocument.Sheets.getByName("Tabelle1") 'Define which Sheet to process. This sheet must exist in the template
objDocument.CurrentController.setActiveSheet(objSheet)
Dim rowposition As Integer 'current spreadsheet row
Dim colposition As Integer 'current spreadsheet column
rowposition = 1 'Note that the array starts at 0, to adress the first spreedsheet row 1 set rowposition = 0
While Not doc Is Nothing
colposition = 0
Print "Preparing Spreadsheet, please wait! Processing "+ doc.Country(0)
Call InsertSpreedsheetCellValue (objSheet, colposition ,rowposition, doc.Test(0))
Call InsertSpreedsheetCellValue (objSheet, colposition ,rowposition, doc.Test_1(0))
Call InsertSpreedsheetCellValue (objSheet, colposition ,rowposition, doc.Test_2(0))
Call InsertSpreedsheetCellValue (objSheet, colposition ,rowposition, doc.BlankColumn(0))
Call InsertSpreedsheetCellValue (objSheet, colposition ,rowposition, doc.Test_3(0))
Call InsertSpreedsheetCellValue (objSheet, colposition ,rowposition, doc.Test_4(0))
rowposition = rowposition+1
Set doc = view.GetNextDocument(doc)
Wend
Call objDocument.storeToURL("file:///"+fileOoA, prop.Values)
Call objDocument.close( True)
Call objDocument.close( True)
Msgbox "Your file is ready! Please open File >> " & Chr(10) & " C:\Temp\Testfile 2011.xxx.ods !!!", 64 ,db.Title
End Sub
Sub InsertSpreedsheetCellValue (objSheet As Variant, colposition As Integer, rowposition As Integer, fieldvalue As String)
Dim cell As Variant
Set Cell = objSheet.getCellByPosition(colposition, rowposition)
Cell.String= FieldValue
colposition = colposition+1
End Sub
MfG Hans