* Werner Tietz [03-04-2008 17:27]:
> Kam gerade in http://de.openoffice.info/viewtopic.php?f=18&t=17004
Hallo Werner,
danke dir, das hilft mir weiter. Ich habe erstmal grob
mein Makro neu zusammengebastelt:
REM ***** BASIC *****
Option Explicit
Sub SubFormRefreshListBoxInAnyGrid()
Dim oForms As Object
Dim oFormHaupt As Object
Dim oFormSub As Object
Dim oFormKunde As Object
Dim oListBox As Object
Dim sFormHauptName As String
Dim sFormKundeName As String
Dim sFormSubName As String
Dim sGridName As String
Dim sListBoxName As String
Dim OOoCurrentVersion As Currency
sFormHauptName = "FormHaupt"
sFormKundeName = "FormKunde"
sFormSubName = "FormFang"
sGridName = "FormFang_Grid"
sListBoxName = "Spalte_Listbox"
oForms = ThisComponent.DrawPage.forms
oFormHaupt = oForms.getByName( sFormHauptName )
oFormKunde = oForms.getByName( sFormKundeName )
oFormSub = oFormHaupt.getByName( sFormSubName )
REM reload ist an dieser Stelle okay, weil nur eine Tabelle sortiert wird
oFormKunde.reload
REM in Version 2.4 funktioniert *.refresh und *.reload nicht!
OOoCurrentVersion = OOoVersion()
If OOoCurrentVersion <> 2.4 Then
oListBox = oFormSub.getByName( sGridName ).getByName( sListBoxName )
oListBox.refresh
Else
oFormSub.unload
oFormSub.load
End If
End Sub
Function OOoVersion() As String
'Retreives the running OOO version
'Author : Laurent Godard
'e-mail : listes.godard (at) laposte.net
Dim aSettings, aConfigProvider
Dim aParams2(0) As new com.sun.star.beans.PropertyValue
Dim sProvider$, sAccess$
sProvider = "com.sun.star.configuration.ConfigurationProvider"
sAccess = "com.sun.star.configuration.ConfigurationAccess"
aConfigProvider = createUnoService(sProvider)
aParams2(0).Name = "nodepath"
aParams2(0).Value = "/org.openoffice.Setup/Product"
aSettings = aConfigProvider.createInstanceWithArguments(sAccess, aParams2())
OOOVersion = aSettings.getByName("ooSetupVersion")
End Function
Ich hoffe, dass in Version 2.4.1 (falls sie kommt) nicht nur 2.4
bei OOoVersion() ausgegeben wird; bei 2.0.4 bekomme ich auch nur 2.0.
Gruß Uwe
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]