OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Delphi + OOo: open/import many doc into a single Writer doc

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Code Snippets
View previous topic :: View next topic  
Author Message
RobertoSchuster
General User
General User


Joined: 14 Aug 2010
Posts: 6
Location: Santa Cruz do Sul - RS - Brazil

PostPosted: Wed Aug 25, 2010 5:50 am    Post subject: Delphi + OOo: open/import many doc into a single Writer doc Reply with quote

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
View user's profile Send private message MSN Messenger
RobertoSchuster
General User
General User


Joined: 14 Aug 2010
Posts: 6
Location: Santa Cruz do Sul - RS - Brazil

PostPosted: Mon Aug 30, 2010 3:59 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
RobertoSchuster
General User
General User


Joined: 14 Aug 2010
Posts: 6
Location: Santa Cruz do Sul - RS - Brazil

PostPosted: Sun Sep 05, 2010 11:46 am    Post subject: Reply with quote

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. Smile
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Code Snippets All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group