Technical article 111124

How can I view the text from a Microsoft Office Word/Excel documents from scomail?

OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7UnixWare 7.1.4

Written · Last revised

Problem

When I get email on SCO OpenServer 5/6, UW7 with Microsoft Office attachments, I have to save them to a file and transfer them to a Windows machine to be able to see the text in them. I'd like a quicker, easier way to see the text in these attachments.

Solution

For MicroSoft Word:

There is an Open Source package called "catdoc" that will enable you to view the text in a Microsoft Word document attached to an email directly from scomail in OpenServer 5. This will keep you from having to save the attachment to a file and transfer it to a machine running Windows just to see the contents of the file.

To install catdoc on your machine and allow scomail to use it, follow these steps:

1. From:
http://www.sco.com/skunkware/uw7/Packages/
download the following:
catdoc-xxxx.pkg

(where "xxxx" is the current version number) into your /tmp directory. You may notice that this package is intended for UnixWare 7, but it will also work on OpenServer 5.

2. Install catdoc with the following:
pkgadd -d /tmp/catdoc-xxxx.pkg
where "xxxx" is the version number.
3. Create a file called:
/usr/local/bin/msword.scoedit

and place the following text in it:

#---------CUT HERE----------
##############################################################
# catdoc converts msword documents to ascii, obtained from opensource
# scoedit uses /usr/tmp for its work directory
# Note: scoedit does not allow for a pipe line as it requires a file.
# This script is called "msword.scoedit" and requires executable
# permissions to be set correctly to run when called. /usr/tmp is used
# as the working directory below by scomail.
fn=$1
fn_new=`echo $fn | cut -d. -f1`
/usr/local/bin/catdoc $fn > ${fn_new}.asc
scoedit ${fn_new}.asc
rm ${fn_new}.asc
# end of script
#---------CUT HERE----------

4. Using your favorite text editor, modify:

/usr/lib/scomail/mailcap

and add the following line, which will let scomail know what to do when it sees an attached file with the "application/msword" MIME type:

application/msword;/usr/local/bin/msword.scoedit %s >/dev/null
2>/dev/null

You can add this line anywhere in the file. Make sure any other lines starting with "application/msword" are commented out. This is a system-wide file, so it will allow any user to be able to see Word documents.

5. root may still be unable to see Word attachments. To enable root to see them, make a file called:

/.mailcap

and place this line in it (the same line as above):

application/msword;/usr/local/bin/msword.scoedit %s >/dev/null
2>/dev/null

6. Give the newly created files the correct permissions by doing:

chmod 755 /usr/local/bin/catdoc
chmod 755 /usr/local/bin/msword.scoedit
chmod 644 /.mailcap

After performing these steps, when someone sends you a Microsoft Word attachment, start scomail and double-click on the name of the attachment or go to "Message -> View Attachment" to see it.

For Excel:
See: ftp://ftp2.sco.com/pub/skunkware/uw7/Packages/xlHtml-0.2.8.pkg
Install the package and run:
# /usr/local/bin/xlHtml myspreadsheet > myfile.html

The file "myfile.html" can now be viewed with a HTML viewer, such as the Mozilla Broswer.

See also

Manual pages: mailcap(F), scomail(XC)

From the Xinuos technical article database, record 111124. Reproduced with permission. The original is at www.sco.com/ta/111124, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.