Sub cbxVerzNameFuellen
Dim strEintraege(2)
Dim myItem as Object
strEintraege(0)="Inhaltsverzeichnis"
strEintraege(1)="Sheetverzeichnis"
strEintraege(2)="Honorarverzeichnis"
oDlg.getControl("cbxVerzName").additems(strEintraege(),1)
oDlg.getControl("cbxVerzName").getItem(1)'selcet the second item of the list
end sub
Last edited by MrProgrammer on Sun Apr 16, 2023 7:21 pm, edited 2 times in total.
Reason:Tagged ✓ [Solved] -- MrProgrammer, forum moderator
In OpenOffice you will find a set of macros to manipulate listboxes
Access these by /Tools /Macros /Organize Macros /OpenOffice Basic : OpenOffice Macros : Tools: Listbox
Study these and you should get all the information you require.
selectItemPos selects/deselects the item at the specified position.
selectItemsPos selects/deselects multiple items at the specified positions.
selectItem
Sub cbxVerzNameFuellen
Dim strEintraege(2)
Dim strVer as String
Dim Eintraege 'as String
Dim oListBoxQuelle as Object
strEintraege(0)="Inhaltsverzeichnis"
strEintraege(1)="Sheetverzeichnis"
strEintraege(2)="Honorarverzeichnis"
oListBoxQuelle=oDlg.getControl("cbxVerzName")
oListBoxQuelle.additems(strEintraege(),1)
xray oListBoxQuelle
Eintraege = oDlg.getControl("cbxVerzName").getItems'ItemCount
msgbox Eintraege
for i=0 to Ubound(Eintraege)
strVer=Eintraege(i)'jeweiligen Namen auslesen
oListBoxQuelle.addItem(strVer,i)'füllen
next
oListBoxQuelle.selectItemPos(0,true)
end sub