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 application using OpenOffice: please help

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> Setup and Troubleshooting
View previous topic :: View next topic  
Author Message
DennisTCarlos
General User
General User


Joined: 12 Aug 2008
Posts: 11

PostPosted: Tue Aug 12, 2008 11:53 am    Post subject: Delphi application using OpenOffice: please help Reply with quote

procedure PleaseHelpMe;
var
doc : ToOoDoc;
begin
doc := ToOoDoc.create('C:/the_os.doc',true,true); // opens this file -- use '' for a new file
with doc do
try
addSub('NomeRazao' , 'Dennis Carlos');
addSub('Endereco' , 'Rua Teste, 70');
addSub('Atividade' , 'atividade teste');

merge;

saveAs('c:/myDocMerged.odt', true);
revert;
substitutions.clear;
open('c:/myDocMerged.odt', true);

finally
free;
end;
end;



I would like to open the document generated 'c:/myDocMerged.odt' with OpenOffice and show the editor preferring maximixed window, but in this case, Open function does not work. Nothing is happening. No error messages.



procedure ToOoDoc.open( fileName : string; hidden : boolean);
var
fileProp : variant;
begin
if not fileExists(fileName)then begin
raise exception.Create('oOoDoc.open: file not found.'+#13#13+filename);
end else begin
isHidden := hidden;
end;
docFileName := fileName;
openURL(convertToURL(docFileName));
isNew := false;
end;

procedure ToOoDoc.openURL(URL : string);
var
fileProp : variant;
begin
close;

if isHidden then begin
fileProp:= CreateProperties(['Hidden', True,'Password','dsfchave']);
end else begin
fileProp := dummyArray;
end;

docs[di].v := StarDesktop.LoadComponentFromURL(URL, '_blank', 0, fileProp);
docs[di].isOpen := true;
end;
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 -> Setup and Troubleshooting 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