Ich habe aus einem Calc-Dokument heraus ein Writer-Dokument aus einer Vorlage heraus erstellt:
Code: Alles auswählen
oDoc = StarDesktop.loadComponentFromURL(sVorlage, "Textdokument", 0, args())
Code: Alles auswählen
oFrames = StarDesktop.getFrames()
For i = 1 to oFrames.getcount()
oFrame = oFrames.getByIndex(i-1)
s = s & CStr(i-1) & " : " & oFrame.getName() & Chr(10)
Next
MsgBox s
setName
[oneway] void
setName( [in] string aName );
Description
sets the name of the frame.
Normally the name of the frame is set initially (e.g. by the creator). The name of a frame will be used for identifying it if a frame search was started. These searches can be forced by:
* XFrame::findFrame()
* XDispatchProvider::queryDispatch()
* XComponentLoader::loadComponentFromURL()
Note: Special targets like "_blank", "_self" etc. are not allowed. That's why frame names shouldn't start with a sign "_".
Parameter aName
the new programmatic name of this frame
Auch ein Versuch mit
Code: Alles auswählen
oFrame = oFrames.findFrame ("Textdokument", 0)
Wo liegt mein Fehler?
Viele Grüße,
Chris