Ask Your Question

Force save as MS Office format for all users,

asked 2019-10-04 17:00:50 +0200

jeffshead gravatar image

updated 2019-10-06 17:52:57 +0200

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 ( but it is outdated.

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

edit retag flag offensive close merge delete


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

gabix gravatar imagegabix ( 2019-10-04 17:06:41 +0200 )edit

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

jeffshead gravatar imagejeffshead ( 2019-10-04 17:11:17 +0200 )edit

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, ...)?

ebot gravatar imageebot ( 2019-10-04 17:13:38 +0200 )edit

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.

gabix gravatar imagegabix ( 2019-10-04 17:17:52 +0200 )edit

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.

jeffshead gravatar imagejeffshead ( 2019-10-04 17:26:30 +0200 )edit

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

Opaque gravatar imageOpaque ( 2019-10-04 17:26:42 +0200 )edit

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.

Mike Kaganski gravatar imageMike Kaganski ( 2019-10-04 17:39:01 +0200 )edit

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.

jeffshead gravatar imagejeffshead ( 2019-10-04 18:24:05 +0200 )edit

There is an option accessible from the menu.

m.a.riosv gravatar imagem.a.riosv ( 2019-10-04 22:05:59 +0200 )edit

2 Answers

Sort by » oldest newest most voted

answered 2019-10-04 22:32:21 +0200

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

<?xml version="1.0"?>
<oor:data xmlns:xs=""  xmlns:xsi=""  xmlns:oor="">
    <dependency file="main" />
    <oor:component-data xmlns:install="" oor:name="Setup" oor:package="org.openoffice">
        <node oor:name="Office">
            <node oor:name="Factories">
                <node oor:name="">
                    <prop oor:name="ooSetupFactoryDefaultFilter" oor:op="fuse" oor:finalized="true">
                        <value>MS Word 2007 XML</value>
                <node oor:name="">
                    <prop oor:name="ooSetupFactoryDefaultFilter" oor:op="fuse" oor:finalized="true">
                        <value>Calc MS Excel 2007 XML</value>
                <node oor:name="">
                    <prop oor:name="ooSetupFactoryDefaultFilter" oor:op="fuse" oor:finalized="true">
                        <value>Impress MS PowerPoint 2007 XML</value>

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

And honestly: better don't do that.

edit flag offensive delete link more


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.

jeffshead gravatar imagejeffshead ( 2019-10-05 15:15:46 +0200 )edit

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

Mike Kaganski gravatar imageMike Kaganski ( 2019-10-06 10:01:59 +0200 )edit

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.

jeffshead gravatar imagejeffshead ( 2019-10-06 16:43:03 +0200 )edit

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

Mike Kaganski gravatar imageMike Kaganski ( 2019-10-06 16:53:02 +0200 )edit

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

jeffshead gravatar imagejeffshead ( 2019-10-06 17:16:23 +0200 )edit

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

Mike Kaganski gravatar imageMike Kaganski ( 2019-10-06 17:19:18 +0200 )edit

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

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

jeffshead gravatar imagejeffshead ( 2019-10-06 17:46:56 +0200 )edit

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

Mike Kaganski gravatar imageMike Kaganski ( 2019-10-06 20:55:57 +0200 )edit

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?

jeffshead gravatar imagejeffshead ( 2019-10-06 21:23:05 +0200 )edit

answered 2019-10-04 23:04:02 +0200

I believe you can create a Menu and link rescue macros.

macro example: Sets the default directory.

And disables Save from the toolbar.

sub SalvarDoc
dim document, dispatcher as object
Dim Nome As String
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("")
    Nome = InputBox("¿Cual es tu nombre?")
    Var1 = Nome
dim args1(1) as new
args1(0).Name = "URL"
args1(0).Value = "file:///C:/Users/GILBERTO/Downloads/Baixados/" & Var1 &".doc"
args1(1).Name = "FilterName"
args1(1).Value = "MS Word 97"
dispatcher.executeDispatch(document, ".uno:SaveAs", "", 0, args1())
end sub

image description

test file

The example has the menu in the file, can be in LibreOffice, for all ...


ATTENTION: If you would like to give more details to your question, use edit in question or add a comment below. Thank you.

If the answer met your need, please click on the ball Descrição da imagem to the left of the answer, to finish the question.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2019-10-04 17:00:50 +0200

Seen: 68 times

Last updated: Oct 06