<<< Date Index >>>     <<< Thread Index >>>

Re: how to view MS files within mutt?



<quote who="phyrster" on Mon, Dec 19, 2005 at 10:57:55PM EST>

> On 22:42 Mon 19 Dec 2005, Patrick Shanahan wrote:
> > * phyrster <phyrster@xxxxxxxxx> [12-19-05 22:19]:
> > > My question is: can Openoffice be launched from within mutt so that when I
> > > press enter on an MS attachment, Oo can open the file for me to view and
> > > edit?
> > 
> > Look into mailcap
> 
> I have this line in ~/.mailcap but it's still not working:
> 
> |application/vnd.oasis.opendocument.text; oowriter2 '%s'; edit=oowriter2 
> '%s'; test=test "$DISPLAY" != "" ;        description="OpenDocument Text"; 
> nametemplate=%.doc
> 
> What exact line shall I put into mailcap in order to view MS files? These
> codes look like puzzles to me.

Likely your using the wrong mimetype. Here's what works for me:

1. I have a line that was setup by OO.o2 in my /etc/mailcap like this:

    application/msword; oowriter2 '%s'; edit=oowriter2 '%s'; \
      test=test "$DISPLAY" ! = ""; nametemplate=%s.doc; \
      description="Microsoft Word Document"

That first part "application/msword;" is what's most important.  You can
find which mimetype to use in that part by checking and example document
using file with the -i switch:

    $ file -i wordattachment.doc
    wordattachment.doc: application/msword
 
With that, when I go to view attachments I just highlight the word doc and
hit <return>, and it opens in oowriter2. Nifty!

2. I also use a console app called antiword to quick-view Word docs in the
console so I also have this line setup by the antiword app:

    application/msword; /usr/bin/antiword '%s'; copiousoutput; \
      description="Microsoft Word Text"; nametemplate=%s.doc

And in ~/.mutt/muttrc there's this line:

    auto_view application/msword

With those two things combined, I have a preview of the word doc from within
the message view. Uber nifty!!

Seth