ich arbeite zwar schon länger mit OOo, aber habe erst jetzt mit den Makros Kontakt aufgenommen. Und wie es am Anfang so ist, gleich mal ein kleines Problem.

Hier der Code, um den es geht:
Code: Alles auswählen
Dim oDialog1 AS Object
Dim oListBox1 AS Object
Dim listeneintraege() AS String
Sub Main
StartDialog
End Sub
Sub StartDialog
GlobalScope.BasicLibraries.loadLibrary("Tools")
oDialog1 = LoadDialog("Standard", "Testdialog")
oListBox1 = oDialog1.GetControl("ListBox1")
oDialog1.Execute()
end sub
Function LoadDialog(Libname as String, DialogName as String, Optional oLibContainer)
Dim oLib as Object
Dim oLibDialog as Object
Dim oRuntimeDialog as Object
If IsMissing(oLibContainer ) then
oLibContainer = DialogLibraries
End If
oLibContainer.LoadLibrary(LibName)
oLib = oLibContainer.GetByName(Libname)
oLibDialog = oLib.GetByName(DialogName)
oRuntimeDialog = CreateUnoDialog(oLibDialog)
LoadDialog() = oRuntimeDialog
End Function
Sub OKPressed
rem RemoveSelected(oListBox1)
rem listeneintraege() = oListBox1.getSelectedItems()
rem msgbox listeneintraege(0)
rem oListbox1.removeitems(0,1)
end sub
Allerdings erhalte ich bei Ausführung der Teile RemoveSelected(oListBox1) immer die Fehlermeldung "Basic-Laufzeitfehler. Eigenschaft oder Methode nicht gefunden".
Aber nicht innerhalb meines Codes, sondern in der Funktion RemoveSelected aus der Listbox-Makrosammlung. Markiert ist die folgende Zeile:
Code: Alles auswählen
MaxIndex = Ubound(oListbox.StringItemList())
Bin für alle gewinnbringenden Antworten dankbar.

Grüße
Andreas