Force save as MS Office format for all users,

I have some Win10 systems that need to be sysprep’ed. I want to have LibreOffice preinstalled and configured so the default for ALL users is to save in MS Office format.

I found this old article (https://listarchives.libreoffice.org/global/users/msg12888.html) but it is outdated.

Please provide current instructions. “MS Word 97” is the old format. I want to use the latest.

Do you really want to get in much trouble? OK then.

Can you elaborate? These are two old PC’s that I’m giving to family members and neither are very computer literate.

Is that right?

Before you continue on this path, please read the FAQ: How to open files from MS Office 2007 or 2010 (.DOCX, .XLSX, …)?

Working in foreign file formats is a straight way to data loss. Do ongoing work in ODF only, and only after finalizing the work export to other formats as necessary.

I appreciate the feedback but I still need to know how to do this. The users are elderly and will not remember to export in a different format so when they send the files that they have created, it is doubtful that the receiver will not know what the files are or how to open them if they have only MS Office installed.

Full ack to all comments discouraging this approach. Don’t force an alien format as default.

Currently all office suites allow to open ODF, MS Office among them. The formatting could of course be suboptimal, but that shouldn’t be a big problem: given that you declare users to be unable to handle saving in another format, it’s unlikely that they will create really complex formatting etc. So - just let them use ODF and minimize the elderly users’ problems.

Having said that: I won’t describe the specific steps for something I personally don’t think is a good thing; just a pointer: this page has some relevant info.

I just tested with Word 2010 and it cannot open any of the test files that I’ve created in LibreOffice and saved with the default format. Word 2010 does not have any issues opening LibreOffice documents that were saved with the ‘Word 2007-365 (*.docx)’ format.

Can someone please explain how I can set the MS Office formats as default for all users? I get it… It’s not a good idea; all previous responders have made that abundantly clear but I’m still asking.

Since I already installed LibreOffice, it looks like the proper way to do this is to place a XML file with .xcd extension in %PROGRAMFILES(x86)%\LibreOffice 4\share\registry but I do not know what code to use.

There is an option accessible from the menu.

Copy and put this to an .xcd file, e.g. DefaultOOXML.xcd:

<?xml version="1.0"?>
<oor:data xmlns:xs="http://www.w3.org/2001/XMLSchema"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:oor="http://openoffice.org/2001/registry">
    <dependency file="main" />
    <oor:component-data xmlns:install="http://openoffice.org/2004/installation" oor:name="Setup" oor:package="org.openoffice">
        <node oor:name="Office">
            <node oor:name="Factories">
                <node oor:name="com.sun.star.text.TextDocument">
                    <prop oor:name="ooSetupFactoryDefaultFilter" oor:op="fuse" oor:finalized="true">
                        <value>MS Word 2007 XML</value>
                    </prop>
                </node>
                <node oor:name="com.sun.star.sheet.SpreadsheetDocument">
                    <prop oor:name="ooSetupFactoryDefaultFilter" oor:op="fuse" oor:finalized="true">
                        <value>Calc MS Excel 2007 XML</value>
                    </prop>
                </node>
                <node oor:name="com.sun.star.presentation.PresentationDocument">
                    <prop oor:name="ooSetupFactoryDefaultFilter" oor:op="fuse" oor:finalized="true">
                        <value>Impress MS PowerPoint 2007 XML</value>
                    </prop>
                </node>
            </node>
        </node>
    </oor:component-data>
</oor:data>

Put the document to the LibreOffice installation’s share/registry directory.

And honestly: better don’t do that.

Thank you! I tested this on a fresh VM. It doesn’t seem to work as expected. The save dialog for Writer defaulted to the .odt format until I saved a test file in .docx. After that, it defaulted to .docx. Same for Calc. However, Impress still defaults to .odp.

You didn’t show what specifically you did. If it doesn’t work for you, it means you made some mistake.

All I did was follow your instructions to a “T”. I copied your code to a text document, renamed the text document to DefaultOOXML.xcd, verified that the extension was correct and saved it to %PROGRAMFILES(x86)%\LibreOffice 4\share\registry.

LibreOffice 4? And which version of LibreOffice do you use??

Sorry, I copied that path from one of my previous posts. The actual path that I saved the file to: C:\Program Files\LibreOffice\share\registry

Please attach the DefaultOOXML.xcd to your question, so that I could try to see what’s wrong.

Forgot to mention in my last comment (can no longer edit it) that I installed Version: 6.3.2.2 (x64).

Attached file (remove.jpg exstention):
C:\fakepath\DefaultOOXML.xcd.jpg(/upfiles/15703771557529404.jpg)

Interesting. Seems like the filename is significant. Renaming the file to J.xcd made all three defaults applied.

That is a surprise. I tried renaming the file a couple of times before I posted that it didn’t work. I’m not sure but I think “default” was in both of the other names that I tried. “j.xcd” worked for me as well. “SaveAsMSOffice.xcd” does not work either. I wonder what the naming restrictions are?