OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Multiple Impress documents at once

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
cootetom
Newbie
Newbie


Joined: 29 Nov 2011
Posts: 3
Location: United Kingdom

PostPosted: Tue Nov 29, 2011 2:05 am    Post subject: Multiple Impress documents at once Reply with quote

Hello,

I've wrote a python script to create an Impress document using pyuno. It works great if I create a new document one at a time but as soon as I run the script two or more times at once I get really weird results. Each document will contain random bits of data from any of the other documents in any order. It's like when it has something ready to place into a document then it will just pick any open document at random to put that content in. I end up with multiple documents but with completely random data inside.

I'm just wondering if this is possible or if I need to stick to one document at a time?

Here is the code I have for connecting to a document...

Code:

self.oo_process = subprocess.Popen(['C:\Program Files (x86)\OpenOffice.org 3\program\simpress.exe',
                           '-accept=socket,host=localhost,port=2002;urp;',
                           '-headless', '-invisible', '-nocrashreport', '-nodefault',
                           '-nofirststartwizard', '-nologo', '-norestore',
                           ])
time.sleep(5)

# connect to the current office application running on the desktop.
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext(
                            'com.sun.star.bridge.UnoUrlResolver',
                            localContext)
self.ctx = resolver.resolve('uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext')
smgr = self.ctx.ServiceManager
desktop = smgr.createInstanceWithContext('com.sun.star.frame.Desktop', self.ctx)

# load a blank presentation into the desktop instance
self.document = desktop.loadComponentFromURL('private:factory/simpress', '_blank', 0, ())


There is then code to put slides and content into the document but it always works with self.document from then on.
_________________
- Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group