Viewing document files
Posted
#1
(In Topic #323)
Regular

What is the best way to view the other document types (.doc, .ODT, .txt)?
Is there a way, for example to display a .doc file in imageview?
Posted
Expert

Do you need to open the document "in program" or just open the document externally for review ?
If just for a review, you can use the Linux application xdg-open {document path}
xdg-open will open most document types within their native applications and is installed on most common Linux distros. You can install easily it if it's not on yours.
From within Gambas you would use something like this:
Code (gambas)
It will also open a web link in your default browser but the path must have the http header included.
just using www.someaddress.com won't work.
For example, using xdg-open with the path:
"Google" & "{search term}+{search term}+…
will open Google in your browser with the results of the search terms that you entered.
Cheers - Quin.
I code therefore I am
I code therefore I am
Posted
Guru

If you add the 'gb.desktop' component you can use If you want to display something like an .odt or .doc then I don't thing Gambas can help you read the files but LibreOffice can convert those files to a text file, below converts the spreadsheet file 'temp.ods' to a 'csv' file: -
Code (gambas)
- 'You now have all the data from temp.ods in your variable sData!
NOTE: If LibreOffice is open then this trick wont work!
Posted
Regular

1 guest and 0 members have just viewed this.

