`

转:HOW-TO: Get Office 2003 running in Wine on Linux

阅读更多

HOW-TO: Get Office 2003 running in Wine on Linux

I've gotten Microsoft Office 2003 working pretty well, if you would like to get Office working in Ubuntu 8.04, here's what you need to do.

First, you'll need to install wine. This can be done using the Add/Remove applet on your menu, or by entering this command in a terminal window:

sudo apt-get install wine

Now that Wine's installed, you'll need to download the core Windows fonts and set them aside for later, so go grab each of the MS Core fonts .exe packages from sourceforge [ HERE ]. You can safely skip wd97vwr32.exe which is the Microsoft Word 97 viewer.

Now, insert your Office 2003 CD and execute SETUP.EXE. I recommend browsing to the setup directory, and then performing the following action in nautilus:

Right Click SETUP.EXE
Select "Open With"
Click the arrow next to "Use a custom command"
Type "wine" in the textbox (without quotes)
Press "Open"

You may see your hard drive light start to flash, but no notification that it's doing anything. That's OK, it's working and the installer will start momentarilly.

Install Microsoft Office normally, note that Outlook currently does not work with the version of Wine that ships with Ubuntu 8.04.

Once the Office installation completes, perform the following actions (Note: For Office 2007, change OFFICE11 to OFFICE12):

Press Alt-F2 (this brings up a RUN prompt)
Type "regedit" (without quotes)
Click "Run"
Browse to: HKLM\Software\Microsoft\Office\11.0\Common\FilesPaths
Change the path to MSO.DLL to: C:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSO.DLL
Close Regedit

Press Alt-F2
Type "winecfg" (without quotes)
Click the Libraries tab
Click the "New override for library" dropdown box
Select "gdiplus"
Click "Add"
Click "Ok"

This tells Office where to find the MSO dll, and sets GDI to native mode. Now we need to install those fonts.

Open a terminal by clicking Applications -> Accessories -> Terminal
Change to the directory containing your exe files downloaded earlier. I'll assume they are in ~/Desktop (the default download path)
Type: "cd ~/Desktop" (without quotes)
Type: "for item in *exe; do wine $item; done" (without quotes)

For each of the dialog boxes, accept the license or click through the OK when prompted.

Now that you have Office installed, we'll need to associate it in GNOME. We'll do this by creating shell scripts which will perform actions based on how it's called. We'll need to repeat this step for Word, Excel, Powerpoint, etc. In our example we'll use Word and Excel.

In your terminal window:
Type: "cd"
Type: "mkdir bin"
Type: "cd bin"
Type: "gedit"

This brings up the Gnome Text Editor. Paste the following code blocks into gedit and save as the appropriate "NAME".

Paste the following and save in your bin directory as "word":
#!/bin/bash
COMMAND=`echo $* | sed -e s#\/#\\\\\\\#g`
if [ ${COMMAND} ]; then
COMMAND='Z:'$COMMAND
fi
wine "C:\Program Files\Microsoft Office\OFFICE11\WINWORD.EXE" "${COMMAND}"

Paste the following and save in your bin directory as "excel":
#!/bin/bash
COMMAND=`echo $* | sed -e s#\/#\\\\\\\#g`
if [ ${COMMAND} ]; then
COMMAND='Z:'$COMMAND
fi
wine "C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE" "${COMMAND}"

Repeat this for any other Office applications you would like to use, be sure to change the .EXE to the appropriate Office executable (I've tested with Word, Excel, Powerpoint, and Access which all seem to work OK.

Next, we'll need to make icons for your new Word, and Excel installation. Do a quick Google search for Icons to use for your Office applications I found some cool ones on deviant art icons like these linked [ HERE ] should work great. Rename each of them to Word.{extension}, Excel.{extension}, etc substituting "{extension}" with the actual file's real extension (Example: Word.png). To create icons on the Gnome menu we'll perform the following actions:

Close Gnome Editor
In your Terminal window, type: "gksu gedit"
Enter your password when prompted.

Paste the following text into Gnome Editor, and save it to the /usr/share/applications directory with the name "word.desktop". Be sure to change the name of the Icon in the "Icon" line below to match your downloaded icon. Don't change the directory to the Icon.

[Desktop Entry]
Version=1.0
Terminal=false
Exec=wine "c:/Program Files/Microsoft Office/OFFICE11/WINWORD.EXE" %U
Icon=/usr/share/pixmaps/Word.png
Type=Application
Categories=Application;Office;WordProcessor;
StartupNotify=false
InitialPreference=5
Name=Microsoft Word
GenericName=Word Processor

Paste the following text into Gnome Editor, and save it to the /usr/share/applications directory with the name "excel.desktop". Be sure to change the name of the Icon in the "Icon" line below to match your downloaded icon. Don't change the directory to the Icon.

[Desktop Entry]
Version=1.0
Terminal=false
Exec=wine "c:/Program Files/Microsoft Office/OFFICE11/EXCEL.EXE" %U
Icon=/usr/share/pixmaps/Excel.png
Type=Application
Categories=Application;Office;Spreadsheet;
StartupNotify=false
InitialPreference=5
Name=Microsoft Excel
GenericName=Spreadsheet

Now that you have desktop files, we need to put the icons into the /usr/share/pixmaps directory. Copy them from wherever they were downloaded and renamed to your home directory. Once they are there, lets close Gnome Editor and go back to your Terminal window.

Type: "cd"
Type: "sudo mv *{extension} /usr/share/pixmaps" where {extension} is the real extension of your files. IE: "sudo mv *png /usr/share/pixmaps"

Now, click Applications -> Office, and you should see Word and Excel. Open each of them to verify they are working correctly.

Lastly, we need to associate .doc and .xls files with Word and Excel. Browse to those types of files in your home directory (or your thumb drive, wherever you store them).

In nautilus, right click a .doc file
Select "Open with Other Application"
Click the arrow next to "Use a custom command"
Click "Browse"
Click your home directory in the left pane
Click bin
Click "word"
Click "Open"
Click "Open"

Your word document should open in Microsoft Word 2003. This also saves this configuration, associating .doc files with Word permanently. If you are installing Office 2007 update to the latest version of Wine from winehq.

Repeat for Excel, and any other Office programs.
Posted by FEWT at 3:57 PM
Email ThisBlogThis!Share to TwitterShare to Facebook
Labels: Linux, Office, Ubuntu, Wine
6 comments:

shamess said...

    I got Office 2007 working too, so you can use that if you prefer.

    I could even get World of Warcraft working, but I guess my machine wasn't fast enough to be emulating and running that. Unfortunately that was a show stopper for me (I'm a terrible addict) so I had to come back to Windows until I find a hard drive I can use.
    June 30, 2008 5:02 AM
∑ฟΔקS said...

    Hey thanks for the Post i tried and it worked. I was wondering if i can do the same thing for gtalk application.
    September 4, 2008 4:38 PM
Anonymous said...

    This method worked with one exception to get powerpoint viewer up and running on Ubuntu 8.04.

    The application icon in my office directory works; the powerpoint interface opens .ppt files as expected.

    However, if I follow the method you describe for file associations and double click on a .ppt file, PowerPoint Viewer tells me it cannot find the file.
    After double-checking the contents of my powerpoint script in /home/myusername/bin/, I tried to reset the custom command under Microsoft PowerPoint in the 'open with' menu.
    I get the message "could not find /home/myusername/bin/powerpoint "

    Any idea as to what I'm doing wrong?
    July 3, 2009 9:16 AM
Anonymous said...

    I took the %U out of the path to open program and that took care of "unable to find file" problem.

    The thing that is not working for me is the .png image doesn't show up right under applications menu, they turn into a window icon and all of them are same, just different names
    August 1, 2009 3:02 AM
Anonymous said...

    Nevermind. All fixed! Had name of icon typed wrong in program.desktop file.
    August 1, 2009 3:09 AM
Anonymous said...

    Hi !.
    might , perhaps curious to know how one can manage to receive high yields .
    There is no need to invest much at first. You may begin earning with as small sum of money as 20-100 dollars.

    AimTrust is what you haven`t ever dreamt of such a chance to become rich
    The company incorporates an offshore structure with advanced asset management technologies in production and delivery of pipes for oil and gas.

    Its head office is in Panama with offices around the world.
    Do you want to become really rich in short time?
    That`s your chance That`s what you wish in the long run!

    I feel good, I started to take up real money with the help of this company,
    and I invite you to do the same. If it gets down to choose a proper partner who uses your savings in a right way - that`s the AimTrust!.
    I take now up to 2G every day, and my first deposit was 1 grand only!
    It`s easy to join , just click this link http://cafadoqemo.lookseekpages.com/ytezesy.html
    and go! Let`s take our chance together to feel the smell of real money
    December 3, 2009 4:58 PM

Post a Comment
Newer Post Older Post Home
Subscribe to: Post Comments (Atom)
./About
The blog at fewt.com is a technology focused site delivering the latest news, views, and reviews to the internet community.
./Contribute
Do you have news or a story to share that readers should know about? Send your tip, story, or suggestion to: tips@fewt.com.

Show your support for Fuduntu, Jupiter, and ~/Blog by disabling adblock for these sites.
./Popular

    Move your logs and temp files to RAM and watch your portable fly!
    Performance Tuning VMWare Server on Ubuntu Linux
    About the Kernel 3.0 "Power Regression" Myth
    Fuduntu 14.10 - Now Available
    Seven months with Windows 7
    Meet Jupiter
    Speed up Open Office!
    Whitelist - A utility script to allow apps to use the Unity System Tray
    Fuduntu Quarterly Release
    Laptop Hacking - Just a little more space

./Writers
FEWT - Owner, Site Admin, Writer
CRandy - Writer
Enalicho - Writer
JBCluff - Writer
./Followers
Facebook - Fuduntu
./Links

    Fuduntu Linux
    Fuduntu Forum
    Jupiter Power Manager
    Donate to Fuduntu, and Jupiter
    Fuduntu @ Distrowatch!
    Aurora OS
    Smart People in IT
    ® Ë Ð V Ø Ï Ð
    The Adventures of RandoBoy
    Its all virtual

./Archive

    ►  2011 (30)
        ►  September (3)
            About the Kernel 3.0 "Power Regression" Myth
            Fuduntu Quarterly Release
            Important Fuduntu Linux Announcement
        ►  July (2)
            Fuduntu 15, Gnome 3 and the future
            Fuduntu 14.10.1 - Updated media to fix boot issue ...
        ►  June (3)
            Fuduntu Programming Challenge Mark 2
            Fuduntu 14.10 - Now Available
            Fuduntu Team Meeting - June 18th @ 8:00AM CST
        ►  May (1)
            Fuduntu 14.10 Release Candidate
        ►  April (6)
            Donation Drive - Update
            Fuduntu - A Good Corporate Citizen
            Fuduntu 14.10 - Firefox or Chromium?
            Team meeting notes - Mar 12, 2011
            Fuduntu - needs hardware - donation drive
            Fuduntu Weekly Update - Improving Terminal
        ►  March (5)
            The Fuduntu Programming Challenge
            Comparison Test: Fuduntu vs Fusion @ Das U-Blog
            Whitelist - A utility script to allow apps to use ...
            Fuduntu 14.9 Stable Released
            Fuduntu 14.9 Release Candidate ready for testing
        ►  February (2)
            Chromium Web Browser now available
            Fuduntu Weekly Update
        ►  January (8)
            Fuduntu Weekly Update
            Linux User and Developer - Fuduntu is included on ...
            Fuduntu Weekly Update - 14.8-3
            Jupiter Applet gets its own home
            Fuduntu 14.8-2 update
            Building a DMZ with DD-WRT
            Fuduntu 14.8 hits the streets
            Fuduntu 14.7-7 - Now with Likewise Open!

    ►  2010 (45)
        ►  December (12)
            Fuduntu 14.7-3 - Fantastic font rendering and VLC!...
            PhotoFilmStrip now available in the Fuduntu reposi...
            Fuduntu 14.7-2 improvements
            Torrents for Fuduntu 14.7 now available.
            Announcing Fuduntu 14.7
            Fuduntu Torrents!
            Fuduntu gets Adobe Flash and Fluendo MP3
            It's Elementary, my dear Fuduntu!
            Fuduntu 14.6 now available
            Fuduntu gets a face lift
            Fuduntu Mailing Lists
            Fuduntu defaults and direction survey
        ►  November (3)
            Fuduntu 14.5 - Subtle improvements
            The Pandigital Novel
            Fuduntu - A Fedora remix for Laptops and Netbooks
        ►  October (4)
            A Primer - Managed Service Delivery
            ~/Blog - Refocused
            Mono icons for Jupiter
            Seven months with Windows 7
        ►  September (6)
            Build a PSP stand using only a business card and r...
        ►  July (2)
        ►  June (9)
        ►  April (1)
        ►  February (4)
        ►  January (4)

    ►  2009 (16)
        ►  November (1)
        ►  October (1)
        ►  August (1)
        ►  July (1)
        ►  June (2)
        ►  May (1)
        ►  April (1)
        ►  March (5)
        ►  January (3)

    ▼  2008 (20)
        ►  December (1)
        ►  July (3)
        ▼  June (16)
            Laptop Hacking - Just a little more space
            HOW-TO: Get Office 2003 running in Wine on Linux
            Performance Tuning VMWare Server on Ubuntu Linux
            Embed RDP sessions between GNOME panels
            SimCity 3000 on Linux HOW-TO
            Background Buddy Wallpaper Software
            Get EUS Working in Ubuntu
            Switch from Windows to Linux and KEEP Windows
            Stream ABC.com on Linux with Wine
            PhotonBBS for Unix and Linux
            Home Theater installation
            RAID - In a spreadsheet?
            Chizzle BBS Style Chat server
            Network Dumper - Log data on a given socket
            TCP/Anywhere - TCP transport through HTTP proxies
            Quickswitch - ATI FGLRX manipulation utility

./License
Creative Commons License
~/Blog content by fewt.com is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

Awesome Inc. template. Powered by Blogger.
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics