| View previous topic :: View next topic |
| Author |
Message |
RobertoSchuster General User


Joined: 14 Aug 2010 Posts: 6 Location: Santa Cruz do Sul - RS - Brazil
|
Posted: Wed Aug 25, 2010 5:50 am Post subject: Delphi + OOo: open/import many doc into a single Writer doc |
|
|
Hello, I have a big problem:
I want to open/import more than one OOo Writer document into a single new document.
In other words, I want to put the content of many diferent documents in one single document (content of Doc1, Doc2 and Doc3 into a NewDoc). For exemple, to create a letter with many diferent parts automatically.
Currently, I can do this using COM automation with Microsoft Word. Now I want to enable my sistem to works with Open Office too.
I am reading the documentation, but until now, I have not found nothing about this funcionality.
Thanks. |
|
| Back to top |
|
 |
RobertoSchuster General User


Joined: 14 Aug 2010 Posts: 6 Location: Santa Cruz do Sul - RS - Brazil
|
Posted: Mon Aug 30, 2010 3:59 am Post subject: |
|
|
To circumvent this problem, I thought about opening a Writer document, copy its contents to the clipboard and then paste it into the new document.
I think it's gona work.. but I don't know hou to copy and paste.
Someone? |
|
| Back to top |
|
 |
RobertoSchuster General User


Joined: 14 Aug 2010 Posts: 6 Location: Santa Cruz do Sul - RS - Brazil
|
Posted: Sun Sep 05, 2010 11:46 am Post subject: |
|
|
Finally I found a way! The right way to do this, I think... (:
| Code: | procedure insertFile;
var
myDoc, fileProp: Variant;
URL: String;
begin
// Open OpenOffice.org and Create a new document
myDoc:= StarDesktop.loadComponentFromURL('private:factory/swriter', '_blank', 0, dummyArray);
// Defines the location of a document
URL := 'file:///C:/Document1.doc';
fileProp:= CreateProperties(['Name', URL]);
// Insert the document
execDispatch('.uno:InsertDoc', fileProp);
end;
|
Well, I hope I can help people with the same problem.  |
|
| Back to top |
|
 |
|