Real Software Forums
http://forums.realsoftware.com/

OpenOffice on Linux
http://forums.realsoftware.com/viewtopic.php?f=8&t=44607
Page 1 of 1

Author:  McDian [ Tue Jul 03, 2012 5:41 pm ]
Post subject:  OpenOffice on Linux

Hey, I am trying to find an example of how to create a file then open that file with OpenOffice.calc or OpenOffice.writer (depending on the need).

1. Can it be done
2. If yes, then how?

All the examples for office related stuff is for Windows. Doesn't help me as I am on Linux.

Thanks again! :D

Author:  charonn0 [ Tue Jul 03, 2012 7:30 pm ]
Post subject:  Re: OpenOffice on Linux

Something like:

Dim sh As New Shell
Dim myDoc As FolderItem
sh.Execute("soffice -o" + myDoc.AbsolutePath)


should work, and should be cross-platform.


Edit: fixed typo

Author:  defconmatrix [ Wed Jul 04, 2012 2:02 am ]
Post subject:  Re: OpenOffice on Linux

charonn0 wrote:
Something like:

Dim sh As New Shell
Dim myDoc As FolderItem
sh.Execute("soffice -o" + SomeFolderItem.AbsolutePath")


should work, and should be cross-platform.

should be more like:
Dim sh As New Shell
Dim myDoc As FolderItem
sh.Execute("soffice -o" + " $HOME/Documents/test.xls") using Bash variable and assuming the text.xls file exists :) . Notice the space before $HOME, very important
What if the person's shell is not Bash? Well, this is not a perfect world. One size does not fit all.

Author:  timhare [ Wed Jul 04, 2012 2:33 am ]
Post subject:  Re: OpenOffice on Linux

No, charonn0 had it right. There's an implied elipsis in his code.
Dim sh As New Shell
Dim myDoc As FolderItem
...
// get an existing file into myDoc
...
sh.Execute("soffice -o" + SomeFolderItem.AbsolutePath") // should probably be ShellPath

Instead of relying on $HOME and bash, use RB constructs like SpecialFolder.Documents, etc., to get a FolderItem. Then use its ShellPath.

Author:  defconmatrix [ Wed Jul 04, 2012 12:26 pm ]
Post subject:  Re: OpenOffice on Linux

No, charonn0 was not right. Look at that original code again. Do you always use a closing" without an opening"? And I tested it BEFORE I posted it. Yes, I am right, now go away.

Author:  charonn0 [ Wed Jul 04, 2012 6:06 pm ]
Post subject:  Re: OpenOffice on Linux

defconmatrix wrote:
No, charonn0 was not right. Look at that original code again. Do you always use a closing" without an opening"? And I tested it BEFORE I posted it. Yes, I am right, now go away.

That was a typo; he was referring to the idea. Why so hostile?

Author:  McDian [ Thu Jul 05, 2012 12:36 pm ]
Post subject:  Re: OpenOffice on Linux

Cool! Thanks! So my next question is do you think Office Automation will come to other systems than Windows? I was reading up on it and would really like to start creating .ods and .xls files from my application. Currently I have the .csv figured out really well.

Author:  simulanics [ Thu Jul 05, 2012 11:13 pm ]
Post subject:  Re: OpenOffice on Linux

Why not just drop a "template" into your project explorer then write the template to disk as file? ..remember files dropped into the ide are stored as a string.. Simply create a text output stream..any file name... With the extention of the xls odt (or any other) and write
OpenOffice template file to disk? ;-) For a Linux system..you could write a command line utility to generate the files or write a class to generate the template files and store the base64encoded template in strings within the class for 'ease-of-use' in other projects. where there's a will...

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/