Darragh Sherwin
Tom Schindl
How can I create an empty document
# Create a new, blank document and get all the specific services required
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__":
# For a connection example see {%internal Office.ConnectViaPipe.snip}
remoteContext = connect()
# How to get services see {%internal Office.FetchingServicesFromDesktop.snip}
deskDict = getDesktopDict( ctx )
documentDict = createNewDocument( deskDict )