Tobias Krais wrote:

> Hi together,
> 
> there were some very interesting discussions the last weeks concerning
> copying text and styles from one document to an other. I would like to
> do similar things. I want to create several template files and copy all
> content of some of these text files in an other document. It'll be a
> kind of document merger, merging text documents as I need it.
> 
> But at the moment I don't find a solution how to select all content of a
> document. Which interface stores all the content?
> 
> Can you help me, please?

The following macro copies the complete content of a whole Writer
document into a new one - in case "selectAll" is able to select this
whole content. At least foot notes and headers/footers can't be copied
that way. But perhaps it's a start:

frame = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim noargs()
dispatcher.executeDispatch(frame, ".uno:SelectAll", "", 0, noargs())

obj = frame.controller.getTransferable()
doc =
stardesktop.loadcomponentfromurl("private:factory/swriter","_blank",0,noargs())
doc.currentController.insertTransferable(obj)

This API is kind of an "internal" clipboard. Currently it only works in
Writer.

Ciao,
Mathias

-- 
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[EMAIL PROTECTED]".
I use it for the OOo lists and only rarely read other mails sent to it.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to