von MyFairTux » Fr, 04.09.2009 17:55
Hallo,
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())
Dieses möchte ich nun in anderen Subs ansprechen. Ich habe es bisher folgendermaßen versucht:
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
Leider wird mir der vergebene Framename "Textdokument" nicht angezeigt, dabei steht in der API-Doku folgendes:
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
brachte leider kein Ergebnis.
Wo liegt mein Fehler?
Viele Grüße,
Chris
Hallo,
Ich habe aus einem Calc-Dokument heraus ein Writer-Dokument aus einer Vorlage heraus erstellt:
[code]oDoc = StarDesktop.loadComponentFromURL(sVorlage, "Textdokument", 0, args())[/code]
Dieses möchte ich nun in anderen Subs ansprechen. Ich habe es bisher folgendermaßen versucht:
[code]
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
[/code]
Leider wird mir der vergebene Framename "Textdokument" nicht angezeigt, dabei steht in der API-Doku folgendes:
[i]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 [/i]
Auch ein Versuch mit
[code]oFrame = oFrames.findFrame ("Textdokument", 0)[/code]
brachte leider kein Ergebnis.
Wo liegt mein Fehler?
Viele Grüße,
Chris