How to install Microsoft office 2007 in Ubuntu 12.04

Default featured post

Libre Office suite is very good and powerful but unfortunately, it has a compatibility issue with MS office files. Most of the time files which are created in MS office do not show properly in Libre office especially MS Word files. Furthermore, this problem exists with Libre Office which means that created files with Libre Office do not show correctly in MS office. Therefore, for people who have to use MS office package at the workplace or university, compatibility is a server issue which is hard to cope with it. As a result, it seems that the alternatives are to install MS office in Linux or using Windows. Since using Microsoft Windows is not preferable by most Linux users, the only remain option is to bring MS office to Linux with the use of Wine emulator. In this post, I will describe how to install Microsoft office 2007 in Ubuntu 12.04.
Some parts of below section are from this source.

Firstly, you need to install Wine, Gecko and Wine tricks. Wine 1.4 is available in Ubuntu 12.04 repository. In order to install the mentioned packages type following line in the command line.

$ sudo apt-get install wine1.4 winetricks wine-gecko1.4

After that, you need to install Microsoft fonts. These fonts are necessary for MS office in order to function properly.

$ sudo apt-get install msttcorefonts

Now, if your Ubuntu is 64 bit (like mine) you need to type below commands as well and if you have 32 bit version just ignore this step.

$ rm -rf ~/.wine
$ export WINEARCH=win32
$ wineboot -update

Note: the first command removes all contents of your Wine folder which is located on your home folder with .wine name. So if you have an important file there, you need to take a backup.
Above commands firstly remove all contents of Wine folder, then change the version of Wine to 32-bit version since MS office does not operate under 64 bit Wine and at the end, Wine configuration is updated.
Now the only remain step is to install some packages and DLLs which are prerequisite of MS office. In order to install the packages, you need to type the following command in the terminal.

$ winetricks dotnet20 msxml3 gdiplus riched20 riched30 vcrun2005

You also can install the packages via the GUI version of Winetricks.
Keep in your mind for msxml3, Winetricks opens a link in your browser which contains a setup file. You should download it and put it in ~/.cache/winetricks/msxml3.
Now after installing the packages you can install Microsoft office and enjoy working it.

Update :

For MS Office 2010, you need an additional step which is installing msxml6 with the following command,

$ winetricks msxml6

If the fonts do not show properly, you need to install TrueType (or simply Windows fonts). To do that, if you have Windows installed in your system, simply copy/paste Fonts folder from your Windows drive to

~/.wine/drive_c/windows/Fonts

If you don’t have Windows,  you can refer to the following links to download and extract them in the aforementioned path,

http://sourceforge.net/projects/corefonts/

For 64bit Wine with 32bit WINEPREFIX

http://askubuntu.com/questions/231587/installing-dotnet-2-0-on-64-bit-machine