I want to convert a LibreOffice document to an MSWord document but I haven't found any tool for the conversion.
Does anyone know how to do this?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
There's a quite useful tool to convert
.odt files (assuming your goal is converting
.odt instead of
.docx) - it's called LibreOffice. LO has a command line interface, allowing for file conversions without opening the
.odt file in the LO GUI.
Here's an extract showing the required command line parameter `--convert-to`` (for LibreOffice 5.1.6):
$ soffice -h LibreOffice 22.214.171.124 10m0(Build:2) Usage: soffice [options] [documents...] Options: (...) --convert-to output_file_extension[:output_filter_name[:output_filter_options]] [--outdir output_dir] files Batch convert files (implies --headless). If --outdir is not specified then current working dir is used as output_dir. Eg. --convert-to pdf *.doc --convert-to pdf:writer_pdf_Export --outdir /home/user *.doc --convert-to "html:XHTML Writer File:UTF8" *.doc --convert-to "txt:Text (encoded):UTF8" *.doc (...) Remaining arguments will be treated as filenames or URLs of documents to open.
docx as output filter name.
soffice --convert-to docx file.odt
would convert the file
file.docx (the parameter
--headless isn't required any more).
Important: the command line command works only if there's no other LO instance running. So, make sure to exit LO before issuing the command.