Can't open office files by double clicking

Questions about Wine on Linux
Locked
vps767
Newbie
Newbie
Posts: 4
Joined: Tue Mar 04, 2014 8:42 am

Can't open office files by double clicking

Post by vps767 »

Hi,
I uninstalled and reinstalled wine and office 2007, and the programs run properly. However, I can't open office files by double clicking, instead I get a wine Error box "There is no Windows program configured to open this type of file." Double clicking worked properly before uninstall/reinstall. Any hints for how to fix this? Some more details below--I did some other things not noted that may have messed things up (uninstall/reinstall playonlinux, etc).

Thanks,
Vince

OS Ubuntu 12.04 64 bit
wine-1.6.1
office 2007 is 32 bit
sudo apt-add-repository --remove ppa:ubuntu-wine/ppa
sudo apt-get --purge remove wine1.6
rm -rf $HOME/.wine
rm -f $HOME/.config/menus/applications-merged/wine*
rm -rf $HOME/.local/share/applications/wine
rm -f $HOME/.local/share/desktop-directories/wine*
rm -f $HOME/.local/share/icons/????_*.xpm
#To clean Open With List, please carefully paste the following commands into a terminal:
rm -f ~/.local/share/mime/packages/x-wine*
rm -f ~/.local/share/applications/wine-extension*
rm -f ~/.local/share/icons/hicolor/*/*/application-x-wine-extension*
rm -f ~/.local/share/mime/application/x-wine-extension*
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get install wine1.6
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Can't open office files by double clicking

Post by dimesio »

vps767
Newbie
Newbie
Posts: 4
Joined: Tue Mar 04, 2014 8:42 am

Re: Can't open office files by double clicking

Post by vps767 »

I don't believe it is the same as the known bug. First, it happens with all office documents regardless of whether there is a space in the name. Second, it has different behaviour, word (or excel) never open up as in the other bug description, instead I get a wine error message as I described. It looks like the file gets recognized by wine, but then the file path for word and excel are somehow not correct after reinstall. I tried to fully remove wine, but somehow some piece must be remaining that I haven't found, since the problem only comes up after reinstall.

Thanks,

Vince
User avatar
dimesio
Moderator
Moderator
Posts: 13367
Joined: Tue Mar 25, 2008 10:30 pm

Re: Can't open office files by double clicking

Post by dimesio »

Unless you've disabled winemenubuilder, Wine should have added those filetype associations when you installed Office. Did you install Office before or after you cleaned up the entries in /.local/share/*? If it was before, then you deleted those associations when you ran the commands to clean the Open with list. If that's the case, you could try reinstalling Office.

You could also try to manually associate the filetypes with the appropriate Office app. In KDE, right-clicking on a file brings up a dialog that allows you to select "Open with" and "Other" and then browse for the app you want to use. There is also a checkbox to always associate that app with that filetype. I imagine other desktops have something similar.

It is also possible that things left behind by POL may prevent any of this from working, particularly if you ever used their script to install Office. You'd have to ask for help with that on the POL forum.
vps767
Newbie
Newbie
Posts: 4
Joined: Tue Mar 04, 2014 8:42 am

Re: Can't open office files by double clicking

Post by vps767 »

I didn't disable winemenubuilder, and I installed office after I cleaned up the entries in /.local/share/*.

The "Open with" and "Other" approach that you suggest unfortunately does not work in ubuntu 12, since the ability to open with a specific file was removed sometime in version 11. I was able to get this to work by installing the tweak package, and then setting any file type related to excel to open with a custom command like
wine "C:\Program Files (x86)\Microsoft Office\Office12\EXCEL.EXE" z:%f
vps767
Newbie
Newbie
Posts: 4
Joined: Tue Mar 04, 2014 8:42 am

Re: Can't open office files by double clicking

Post by vps767 »

One more update for completeness... The command
wine "C:\Program Files (x86)\Microsoft Office\Office12\WINWORD.EXE" z:%f
didn't work for files with spaces in the name, unlike excel which doesn't mind spaces. The error message suggests that the file name was URL encoded. Instead, I opened with a custom command of a file like
#!/bin/bash
wine "C:\Program Files (x86)\Microsoft Office\Office12\WINWORD.EXE" "`winepath -w "$@"`"
Locked