views:

48

answers:

0

Hi

I'm trying to script my OpenOffice document (Writer in my case) to do some simple things with widgets. Namely I'd like to copy text from widget to widget. For this I want to get one component and than get text from it.

I've been trying to do sth like this:

document   = ThisComponent.CurrentController.Frame

oDocument      =  ThisComponent
oTextBoxFrom = document.getByName("Text Box 1")    # 1
oTextBoxFrom = oDocument.getByName("Text Box 1")   # 2

Neither version #1 nor #2 work. VB compiler spits out that "Text Box 1" is not accessible, however I have that component in my form. My guess is that I'm trying to get this component from a wrong place, eg. not it's frame. I just can't figure out what is the structure of the document.

This seems like a pretty easy task, however I'm unable to find any OpenOffice specification as for accessing OO UNO objects from VB, or python.