Python problem

Terje Johannesen
12/03/2003 11:30 am
Hello.
I am trying to use the OLE functionality with Python, but have some trouble. I have tried to run OE, but it seems like I can only get some of the functions to work. So far, so good:

oeapp = Dispatch("OE.MainOE")
oepro = Dispatch("OE.OEProject")
oecon = Dispatch("OE.OEConnection")
oefol = Dispatch("OE.OEFolder")

Then I try to write for example:
oeapp.AddFolder() and it works perfect. It creates a new folder. But, if I write oefol.AddProject(), nothing happens. Not even an error. But, no new project is created either. What do I do wrong?

(As for future improvements, I would have loved a more comprehensive help function on OLE objects that included a few simple examples.)
Oleg Chernavin
12/03/2003 04:10 pm
The problem is that you don`t have to create OEFolder, OEProject objects, but get them from MainOE object:

oeapp = Dispatch("OE.MainOE")
oefol = oeapp.AddFolder()
oefol.Caption = "SomeFolder"
oepro = oefol.AddProject()
oepro.Caption = "SomeProject"
oepro.URL = "http://www.server.com/"
...


> (As for future improvements, I would have loved a more comprehensive help function on OLE objects that included a few simple examples.)

Offline Explorer Enterprise includes two examples - one made in Delphi, another - Visual Basic. They have simple functionality, but show main principles of how to control Offline Explorer Enterprise via OLE Automation.

However I am not familiar with Python myself and I haven`t included that example there. If you will be able to make your Python program, could you provide us with a working sample (it could be a very simple code)? We would include it in future versions.

Thank you!

Best regards,
Oleg Chernavin
MP Staff