Hi OpiWahn
ja aOpt1() ist ein Array von Objekten:
aOpt1(0) ist ein Objekt vom Typ "com.sun.star.comp.forms.
OGroupBoxModel"
aOpt1(1) ist ein Objekt vom Typ "com.sun.star.comp.forms.
ORadioButtonModel"
aOpt1(2) ist ein Objekt vom Typ "com.sun.star.comp.forms.
ORadioButtonModel"
aOpt1(3) ist ein Objekt vom Typ "com.sun.star.comp.forms.
ORadioButtonModel"
aOpt1(4) ist ein Objekt vom Typ "com.sun.star.comp.forms.
ORadioButtonModel"
F3K Total hat geschrieben:bei mir klappts ...
Ich habe es also selbst ausprobiert.
Was Du natürlich nicht vergessen darfst ist es, wenistens einen Optionsknopf auszuwählen.
Vielleicht hat auch dein Formular einen Fehler?
Oder schlicht der Msgbox-Befehl?
Ich empfehle Dir das "Xray Tool"
http://bernard.marcelly.perso.sfr.fr/index2.html, damit kann man seine Formulare analysieren und gucken welche Kontrollfelder welche Eigenschaften haben.
Unten der Code, der bei mir läuft.(Wenn du kein Xray hast, musst du die Zeile rausnehmen)
Code: Alles auswählen
Sub proofOptions
Dim oForm as Object
Dim aOpt1(), aOpt2(), aOpt3(), aOpt4()
Dim s1$, s2$, s3$, s4$
oForm = thisComponent.drawpage.forms(0)
oForm.getGroupByName("optgrp1", aOpt1)
for i=LBound(aOpt1) to UBound(aOpt1)
xray aOpt1(i)
if aOpt1(i).supportsservice("com.sun.star.awt.UnoControlRadioButtonModel") then
if aOpt1(i).state then
s1 = "Gewählte Optionen:" & Chr$(10) &_
"Name: " & aOpt1(i).name & CHR$(10) &_
"Status: " & aOpt1(i).state & CHR$(10) &_
"Label: " & aOpt1(i).Label
end if
end if
next
msgbox s1 , 0, "Ihre Wahl:"
End Sub
Gruß R