How to set microsoft files as default extension in Libreoffice 7.04?

Hi,
We want set default file save to microsoft extensions for all users in libreoffice 7.04 in Ubuntu 20.04 OS.

Users login through Vmware Ubuntu VDI to access libreoffice.
I saw there is an option in main.xcd file (/opt/libreoffice7.0/share/registry & /usr/lib/libreoffice/share/registry/ )
to set default to MS Word 2007, i changed main.xcd file settings in librewriter to MS Word 2007 it worked but same setting is not getting applied for librecalc and impress.

Kindly suggest how to set .docx,xlxs,pptx as default for librewriter,librecalc & Impress in main.xcd file.

Regards,
Rajesh

For one user: menu Tools → Options → Load/Save → General, make your choices for Document type and Always save as. Diffing the registrymodifications.xcu before and after may give you an idea of the configuration nodes and content.

Generally not recommended though, it’s better to always save in native ODF formats and only when needed convert to / export as alien MS formats.

However, modifying the installation’s main.xcd isn’t a good idea either, it will get overwritten on updates, rather place an additional .xcd file aside in the share/registry directory. See Deployment and Migration, Post deployment configuration. That doesn’t help against conflicting settings in different .xcd files though. For die-hards there’s also the possibility to place a share/registry/data/somename.xcu file with a relevant configuration snippet, which are read after .xcd

But best, note the Configuration Extension approach mentioned at the end of that deployment section, which if installed as a shared extension would be the preferred way to make such pre-sets available to everyone.

Thanks for the reply,

I was checking for option to create .xcu file under share/registry/data. I am not finding /data directory under registry.
Should i create /data directory ?

Yes.

//DON’T READ THIS. I misread the question.

I run Kubuntu, so I assume Ubuntu is similar.
There is probably a GUI way to do it in Ubuntu. Maybe you can right click your .DOC file and choose an application from a list.

ANOTHER WAY:

Find the text file

~/.config/mimeapps.list

It will look something like this:

===================================

[Added Associations]

application/rtf=libreoffice7.2-writer.desktop;libreoffice7.1-writer.desktop;

application/x-designer=org.kde.kate.desktop;

application/x-wine-extension-ini=org.kde.kate.desktop;

application/xml=org.kde.kate.desktop;

inode/directory=org.kde.dolphin.desktop;

text/x-c++src=org.kde.kate.desktop;

video/mp4=vlc.desktop;

[Default Applications]

application/rtf=libreoffice7.2-writer.desktop;

application/x-designer=org.kde.kate.desktop;

application/x-wine-extension-ini=org.kde.kate.desktop;

application/xml=org.kde.kate.desktop;

inode/directory=org.kde.dolphin.desktop;

text/x-c++src=org.kde.kate.desktop;

video/mp4=vlc.desktop;

===================================

Hopefully, that will give you some ideas.

That’s completely unrelated to the question though.

Oh sorry. I misread your question.
You want to change the default Save file.

Hi,
Presently users login through Vmware VDI to access Ubuntu OS.The VDI Ubuntu OS is on non-persistent mode , the Ubuntu image including libreoffice config directory will get erased once the user logs out.

They will get new Ubuntu OS from the golden image once they login back and new user profile will be created.

Whatever user settings is done will not be saved , hence i am exploring to do settings directly on the golden image.

As suggested by “erAck” , I explored extension manager option and also got .oxt file to save microsoft as default. This works fine on the individual user account and not applying for other users , we want to add this extension file for all the users on the libre office base .
Kindly suggest how to add this extension file on the libre office base so that all the users should get extension file by default once they access libreoffice.

Read at the end of the wiki section I linked in my answer, namely Configuration Extension, specifically the PDF linked there. In short: install your extension as shared extension in the “golden image”. Citing from the PDF:

unopkg add --shared my_config_extension.oxt

When i execute this command , it throws below error

sudo unopkg add --shared Sample_LO_configuration_extension.oxt

ERROR: (com.sun.star.lang.IllegalArgumentException) { { { Message = “There is no such extension deployed: org.openoffice.legacy.msoff.oxt”, Context = (com.sun.star.uno.XInterface) @5611b125bae0 } }, ArgumentPosition = (short) -1 }

ERROR: (com.sun.star.lang.IllegalArgumentException) { { { Message = “There is no such extension deployed: org.openoffice.legacy.msoff.oxt”, Context = (com.sun.star.uno.XInterface) @5611b12bd920 } }, ArgumentPosition = (short) -1 }

ERROR: (com.sun.star.lang.IllegalArgumentException) { { { Message = “There is no such extension deployed: org.openoffice.legacy.msoff.oxt”, Context = (com.sun.star.uno.XInterface) @5611b125bae0 } }, ArgumentPosition = (short) -1 }

ERROR: (com.sun.star.lang.IllegalArgumentException) { { { Message = “There is no such extension deployed: org.openoffice.legacy.msoff.oxt”, Context = (com.sun.star.uno.XInterface) @5611b12bd920 } }, ArgumentPosition = (short) -1 }

I tried deleting user profile also.

Where does that org.openoffice.legacy.msoff.oxt originate? And where did you copy it from and why? Seems it tries to update an extension or requires a prerequisite that does not exist. Upload your description.xml so we can see.

i have copied description.xml file below , this extension file is working fine, if i apply using extension manager in Libeoffice:

<?xml version="1.0" encoding="UTF-8"?>

<version value="1.0.2"/>

<platform value="all" />

<display-name>
   <name lang="en">Sample Configuration Extension</name>
</display-name>

 <icon>
   <default xlink:href="images/donateLO.png" />
   <high-contrast xlink:href="images/donateLO.png" />
 </icon>

<extension-description>

Does this command output something with org.openoffice.legacy.msoff?
unopkg list --shared

rajesh@UC24499ISUC-ground:~$ unopkg list --shared

All deployed shared extensions:

Identifier: org.openoffice.legacy.Sample_LO_configuration_extension.oxt
Version: 1.0.2
URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu35032dazx0f.tmp_/Sample_LO_configuration_extension.oxt
is registered: yes
Media-Type: application/vnd.sun.star.package-bundle
Description:
A common sysadmin task is to provide good defaults. LibreOffice settings
can be managed with a shared extension installed by the sysadmin that overrides
builtin defaults.

-Save as .doc, save as .xls.
-use Times New Roman Font
-British locale (A4 paper size)
-Disable GetInvolved and Donate infobar
-Disable Tip of the Day
-Disable automatic online updates.

bundled Packages: {
URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu35032dazx0f.tmp_/Sample_LO_configuration_extension.oxt/common.xcu
is registered: yes
Media-Type: application/vnd.sun.star.configuration-data
Description:

  URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu35032dazx0f.tmp_/Sample_LO_configuration_extension.oxt/jobs.xcu
  is registered: yes
  Media-Type: application/vnd.sun.star.configuration-data
  Description: 

  URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu35032dazx0f.tmp_/Sample_LO_configuration_extension.oxt/setup.xcu
  is registered: yes
  Media-Type: application/vnd.sun.star.configuration-data
  Description: 

  URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu35032dazx0f.tmp_/Sample_LO_configuration_extension.oxt/writer.xcu
  is registered: yes
  Media-Type: application/vnd.sun.star.configuration-data
  Description: 

}

Identifier: org.openoffice.legacy.msoff.oxt
Version: 1.0.2
URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu40728dchrx9.tmp_/msoff.oxt
is registered: yes
Media-Type: application/vnd.sun.star.package-bundle
Description:
A common sysadmin task is to provide good defaults. LibreOffice settings
can be managed with a shared extension installed by the sysadmin that overrides
builtin defaults.

-Save as .doc, save as .xls.
-use Times New Roman Font
-British locale (A4 paper size)
-Disable GetInvolved and Donate infobar
-Disable Tip of the Day
-Disable automatic online updates.

bundled Packages: {
URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu40728dchrx9.tmp_/msoff.oxt/common.xcu
is registered: yes
Media-Type: application/vnd.sun.star.configuration-data
Description:

  URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu40728dchrx9.tmp_/msoff.oxt/jobs.xcu
  is registered: yes
  Media-Type: application/vnd.sun.star.configuration-data
  Description: 

  URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu40728dchrx9.tmp_/msoff.oxt/setup.xcu
  is registered: yes
  Media-Type: application/vnd.sun.star.configuration-data
  Description: 

  URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu40728dchrx9.tmp_/msoff.oxt/writer.xcu
  is registered: yes
  Media-Type: application/vnd.sun.star.configuration-data
  Description: 

}

==================
Sample_LO_configuration_extension.oxt is the extension file trying to apply

Don’t know what you did, but you have two extensions installed, apparently with similar content but different identifiers, org.openoffice.legacy.Sample_LO_configuration_extension.oxt and org.openoffice.legacy.msoff.oxt. I’d suggest you remove the sample one with

unopkg remove --shared org.openoffice.legacy.Sample_LO_configuration_extension.oxt

I removed all the extensions and listed the below command

unopkg list --shared
All deployed shared extensions:

Then i installed the msoff.oxt

ls -ls msoff.oxt
12 -rw-rw-r-- 1 root root 8832 Nov 19 09:00 msoff.oxt

unopkg add --shared msoff.oxt

ERROR: (com.sun.star.lang.IllegalArgumentException) { { { Message = “There is no such extension deployed: org.openoffice.legacy.msoff.oxt”, Context = (com.sun.star.uno.XInterface) @55f9de10b870 } }, ArgumentPosition = (short) -1 }

ERROR: (com.sun.star.lang.IllegalArgumentException) { { { Message = “There is no such extension deployed: org.openoffice.legacy.msoff.oxt”, Context = (com.sun.star.uno.XInterface) @55f9de16f500 } }, ArgumentPosition = (short) -1 }

ERROR: (com.sun.star.lang.IllegalArgumentException) { { { Message = “There is no such extension deployed: org.openoffice.legacy.msoff.oxt”, Context = (com.sun.star.uno.XInterface) @55f9de10b870 } }, ArgumentPosition = (short) -1 }

ERROR: (com.sun.star.lang.IllegalArgumentException) { { { Message = “There is no such extension deployed: org.openoffice.legacy.msoff.oxt”, Context = (com.sun.star.uno.XInterface) @55f9de16f500 } }, ArgumentPosition = (short) -1 }

While adding the extension it throws an error as listed above

but it is listing the extension

unopkg list --shared

All deployed shared extensions:

Identifier: org.openoffice.legacy.msoff.oxt
Version: 1.0.2
URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu12239h81nfm.tmp_/msoff.oxt
is registered: yes
Media-Type: application/vnd.sun.star.package-bundle
Description:
A common sysadmin task is to provide good defaults. LibreOffice settings
can be managed with a shared extension installed by the sysadmin that overrides
builtin defaults.

-Save as .doc, save as .xls.
-use Times New Roman Font
-British locale (A4 paper size)
-Disable GetInvolved and Donate infobar
-Disable Tip of the Day
-Disable automatic online updates.

bundled Packages: {
URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu12239h81nfm.tmp_/msoff.oxt/common.xcu
is registered: yes
Media-Type: application/vnd.sun.star.configuration-data
Description:

  URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu12239h81nfm.tmp_/msoff.oxt/jobs.xcu
  is registered: yes
  Media-Type: application/vnd.sun.star.configuration-data
  Description: 

  URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu12239h81nfm.tmp_/msoff.oxt/setup.xcu
  is registered: yes
  Media-Type: application/vnd.sun.star.configuration-data
  Description: 

  URL: vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/lu12239h81nfm.tmp_/msoff.oxt/writer.xcu
  is registered: yes
  Media-Type: application/vnd.sun.star.configuration-data
  Description: 

}

Still not showing up in the extension manager
Libreoffice version used is 7.1.5.2