Hi,
here's a response I've made a fewminutes ago to the French LibO users list.
Le 30/01/2011 23:49, spasmous@gmail.com a écrit :
I see there are several replies that involve setting each extension one by
one. It would make sense to have an option in LibreOffice to select all
possible formats that can be opened by LibreOffice. The VLC media player has
such an option and is very useful - there are dozens of formats and it's
convenient that one program can handle them all.
NB : for a direct use, see help option /?
And here's for an automated use.
1. Create two text files with the desired parameters.
These files can be created with a command pipe (this what I've done to
get those files).
The data below are what I'm using for OOo installs. Feel free to adapt
for LibO.
a. Extensions File, that I name MSOext.txt
I got it by typing
assoc > MSOext.txt
then eliminating useless entries.
8< ------------------------------------
.doc=OpenOffice.org.Doc
.docm=OpenOffice.org.Docm
.docx=OpenOffice.org.Docx
.dot=OpenOffice.org.Dot
.dotm=OpenOffice.org.Dotm
.dotx=OpenOffice.org.Dotx
.pot=OpenOffice.org.Pot
.potm=OpenOffice.org.Potm
.potx=OpenOffice.org.Potx
.pps=OpenOffice.org.Pps
.ppt=OpenOffice.org.Ppt
.pptm=OpenOffice.org.Pptm
.pptx=OpenOffice.org.Pptx
.rtf=OpenOffice.org.Rtf
.xls=OpenOffice.org.Xls
.xlsb=OpenOffice.org.Xlsb
.xlsm=OpenOffice.org.Xlsm
.xlsx=OpenOffice.org.Xlsx
.xlt=OpenOffice.org.Xlt
.xltm=OpenOffice.org.Xltm
.xltx=OpenOffice.org.Xltx
------------------------------------ >8
b. Types File, that I'm naming MSOtypes.exe
I got it by typing
ftype > MSOtypes.txt
then eliminating useless entries.
(beware to text wrap. One line per type)
8< ------------------------------------
OpenOffice.org.Doc="C:\Program Files\OpenOffice.org
3\program\\swriter.exe" -o "%1"
OpenOffice.org.Docm="C:\Program Files\OpenOffice.org
3\program\\swriter.exe" -o "%1"
OpenOffice.org.Docx="C:\Program Files\OpenOffice.org
3\program\\swriter.exe" -o "%1"
OpenOffice.org.Dot="C:\Program Files\OpenOffice.org
3\program\\swriter.exe" -o "%1"
OpenOffice.org.Dotm="C:\Program Files\OpenOffice.org
3\program\\swriter.exe" -o "%1"
OpenOffice.org.Dotx="C:\Program Files\OpenOffice.org
3\program\\swriter.exe" -o "%1"
OpenOffice.org.Pot="C:\Program Files\OpenOffice.org
3\program\\simpress.exe" -o "%1"
OpenOffice.org.Potm="C:\Program Files\OpenOffice.org
3\program\\simpress.exe" -o "%1"
OpenOffice.org.Potx="C:\Program Files\OpenOffice.org
3\program\\simpress.exe" -o "%1"
OpenOffice.org.Pps="C:\Program Files\OpenOffice.org
3\program\\simpress.exe" -o "%1"
OpenOffice.org.Ppt="C:\Program Files\OpenOffice.org
3\program\\simpress.exe" -o "%1"
OpenOffice.org.Pptm="C:\Program Files\OpenOffice.org
3\program\\simpress.exe" -o "%1"
OpenOffice.org.Pptx="C:\Program Files\OpenOffice.org
3\program\\simpress.exe" -o "%1"
OpenOffice.org.Rtf="C:\Program Files\OpenOffice.org
3\program\\swriter.exe" -o "%1"
OpenOffice.org.Xls="C:\Program Files\OpenOffice.org
3\program\\scalc.exe" -o "%1"
OpenOffice.org.Xlsb="C:\Program Files\OpenOffice.org
3\program\\scalc.exe" -o "%1"
OpenOffice.org.Xlsm="C:\Program Files\OpenOffice.org
3\program\\scalc.exe" -o "%1"
OpenOffice.org.Xlsx="C:\Program Files\OpenOffice.org
3\program\\scalc.exe" -o "%1"
OpenOffice.org.Xlt="C:\Program Files\OpenOffice.org
3\program\\scalc.exe" -o "%1"
OpenOffice.org.Xltm="C:\Program Files\OpenOffice.org
3\program\\scalc.exe" -o "%1"
OpenOffice.org.Xltx="C:\Program Files\OpenOffice.org
3\program\\scalc.exe" -o "%1"
------------------------------------ >8
2. Finally, the shell script that fits the bill
8< ------------------------------------
setlocal
set _Types=%~dp0MSOtypes.txt
set _Ext=%~dp0MSOext.txt
FOR /F "tokens=* delims=" %%G IN (%_types%) DO FTYPE %%G> nul
FOR /F "tokens=* delims=" %%G IN (%_ext%) DO ASSOC %%G> nul
endlocal
------------------------------------ >8
Here we are...
I'm using the script above any time I need to ensure the associations
are OK, eg after installing MSOffice Viewers.
HTH,
--
Jean-Francois Nifenecker, Bordeaux
--
Unsubscribe instructions: E-mail to users+help@libreoffice.org
List archive: http://listarchives.libreoffice.org/www/users/
*** All posts to this list are publicly archived for eternity ***
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.