Hi,
I would like to copy the selected cells of a QTable and paste them in a Word document. How can I do that ? I haven't seen in the Qt Assistant something that could help me...![]()
Thanks in advance.
Hi,
I would like to copy the selected cells of a QTable and paste them in a Word document. How can I do that ? I haven't seen in the Qt Assistant something that could help me...![]()
Thanks in advance.
Yes, but the aim is to create the same array in the Word document than the selected rows of the QTable. And I don't know how I can manage to do this because I could make it by using QPixmap but I will have a picture in my Word document, no ?
You could try to encode that table in HTML or copy some table into clipboard and see how it was encoded. Other solution you might try is to use Word's COM interface --- it probably will be more reliable, but it also requires more work.
You mean using "QClipboard::setText" with a QString containing the code in HTML ?Originally Posted by jacek
(Thank you for your quick answers !)
I would rather try QClipboard::setData() / QClipboard::setMimeData().Originally Posted by greencastor
I must admit that I have difficulties understanding how to use the class "QMimeSource" (for the function "void Clipboard::setData ( QMimeSource * src )")...![]()
You must create your own class that inherits from QMimeSource and implement all abstract methods.Originally Posted by greencastor
But first write a small application that dumps data from cliboard to see that Word puts there. You might try also clipbrd.exe, but it won't give you much information.
isn't there a generic way to do that for all word processing programms (openoffice writer, kword, abiword, ms word...)?
regards..
aman..
I suppose all of them support HTML as suggested by jacek.Originally Posted by aMan
Qt Code:
// qt4 code mime->setHtml("<table border=2><tr><td>1</td></tr><tr><td>2</td></tr></table>");To copy to clipboard, switch view to plain text mode
Edit: seems to only work with MS Word, not with KWord nor OO..![]()
Last edited by jpn; 23rd August 2006 at 21:12.
J-P Nurmi
Thank you guys, I'm going to test it !
Bookmarks