 | OO-Snippets: fetching services from desktopCommons| Keywords | |
|---|
| Language | Python |
|---|
| Application | Office |
|---|
| Authors | Darragh Sherwin (initial)
Tom Schindl (initial)
|
|---|
| Supported Versions | |
|---|
| Supported OS | |
|---|
| Question | How can I fetch all services from the desktop?
|
|---|
| Answer | |
|---|
def getDesktopDict( ctx ):
desktop = ctx.ServiceManager.createInstanceWithContext( "com.sun.star.frame.Desktop", ctx )
document = desktop.getCurrentComponent()
controller = document.getCurrentController()
viewCursor = controller.getViewCursor()
document.RecordChanges = False
return { 'desktop' : desktop,
'document' : document,
'controller' : controller,
'viewcursor' : viewCursor }
if __name__=="__main__":
remoteContext = connect()
deskDict = getDesktopDict( ctx )
|
Changelog| Date | User | Modification |
|---|
| 2005-10-15 | tomsontom | Initial version |
|