Hi again

I answer myself as i found ;)

digging into the SDK, i found
ooo_sdk/examples/DevelopersGuide/OfficeDev/DisableCommands
and the java code is totally understandable

I had to adapt to my extension, but globaly, here is the code at the end of this mail.
No need to restart

so thanks to carsten driesner for its code in the SDK

one thing i have to now find is the name of the Legacy menu entries. Is it the .uno: names ?

Thanks again

Laurent

'-------------------------

sub test
conf = getConfigSetting("/org.openoffice.Office.Commands/Execute/Disabled" ,true)
  elem = conf.createInstanceWithArguments(array())

elem.setPropertyValue("Command","vnd.sun.star.script:Myextension.Module.action?language=Basic&location=application")
        
        conf.insertByName("action",elem)      
        conf.commitChanges()
end sub

'--------------------------

function getConfigSetting(target as string, forUpdate as boolean)

        dim aParams(0) As new com.sun.star.beans.PropertyValue

        if forUpdate then
                service = "com.sun.star.configuration.ConfigurationUpdateAccess"
        else
                service = "com.sun.star.configuration.ConfigurationAccess"
        endif
        
aConfigProvider = createUnoService( "com.sun.star.configuration.ConfigurationProvider" )
        aParams(0).Name = "nodepath"
        aParams(0).Value = target
aSettings = aConfigProvider.createInstanceWithArguments(service, aParams() )
        
        getConfigSetting = aSettings

end function


--
Laurent Godard <[EMAIL PROTECTED]> - Ingénierie OpenOffice.org - http://www.indesko.com Nuxeo Enterprise Content Management >> http://www.nuxeo.com - http://www.nuxeo.org
Livre "Programmation OpenOffice.org", Eyrolles 2004-2006

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to