 | OO-Snippets: create documentCommons| Keywords | |
|---|
| Language | Python |
|---|
| Application | Office |
|---|
| Authors | Darragh Sherwin (initial)
Tom Schindl (initial)
|
|---|
| Supported Versions | |
|---|
| Supported OS | All |
|---|
| Question | How can I create an empty document
|
|---|
| Answer | |
|---|
def createNewDocument( deskDict, url="private:factory/swriter" ):
newDocument = deskDict['desktop'].loadComponentFromURL( url, "_blank", 0, () )
controller = newDocument.getCurrentController()
viewCursor = controller.getViewCursor()
return { 'document' : newDocument,
'controller' : controller,
'viewcursor' : viewCursor,
'desktop' : deskDict['desktop']
}
if __name__=="__main__":
remoteContext = connect()
deskDict = getDesktopDict( ctx )
documentDict = createNewDocument( deskDict )
|
|