I'm trying to write a macro which in part needs to copy the entire text of a document, preserving its formatting, into a newly created empty text shape. I then want to set the width of the shape and retrieve it's height.
However, although I've succeeded in copying & pasting text using executedispatch & uno:Copy/Paste, I've so far been unable to place the copied text within the shape, as opposed to outside it or overwriting it. As far as I can tell, the problem appears to be, having selected the shape, in setting it into edit mode to accept an incoming paste - or maybe in placing the view cursor within it.
Has anyone got any working sample code or ideas on how to do this?
Writer cut & paste
Re: Writer cut & paste
Try this thread: http://www.oooforum.org/forum/viewtopic ... hape+basicfreddy wrote:I've so far been unable to place the copied text within the shape,
It contains information on how to add text in rectangle shape and refers to another useful thread covering an introduction to draw and basic shapes (http://www.oooforum.org/forum/viewtopic.phtml?t=5383).
Regards
hol.sten
OOo 3.2.0 on Ubuntu 10.04 • OOo 3.2.1 on Windows 7 64-bit and MS Windows XP
Re: Writer cut & paste
Thanks for that. I still haven't found how to 'paste' text into a shape though - which is needed in order to preserve formatting. I got around the problem by finding out how to retrieve the true size of a frame, which meant I could use a frame instead.
Re: Writer cut & paste
Could you post some working code? It might help others with the same problem.freddy wrote:I got around the problem by finding out how to retrieve the true size of a frame, which meant I could use a frame instead.
OOo 3.2.0 on Ubuntu 10.04 • OOo 3.2.1 on Windows 7 64-bit and MS Windows XP