[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Ver .doc desde Netscape



He puesto en marcha en mi Debian unos scripts para poder ver directamente desde el Netscape
los documentos de word 8 (office97)
Estaban en la web de mswordview pero no funcionaban en mi debian.
Son dos scripts: nswordview y nsopen.
Para que funcionen en Debian hay que decirles donde esta el tcsh, ellos suponen que esta en
/bin pero en Debian lo tenemos en /usr/bin

Ademas la llamada a mswordview desde nswordview la he cambiado porque creaba un documento
vacio.

En netscape>edit>preferences>navigator>applications se edita la opcion Microsoft Word
Document y ponemos el comando /usr/bin/nswordview %s
Y si un enlace apunta a un archivo .doc, cuando pinchas te lo convierte en .html y te lo
muestra sobre la marcha.
Hay que tener cuidado con el directorio /tmp porque crea alli los archivos html convertidos y
si no los borras crece y crece.

Os los adjunto porque son muy cortos y espero que no cargue mucho la red.


Saludos

David
#!/usr/bin/tcsh

if ($#argv != 1) then
    echo "Usage: $0 file"
    exit 1
endif

set file = $argv[1]
if (!(-r $file)) then
    echo "$0: File $file cannot be read"
    exit 1
endif

#Try to open file in an existing netscape window
(netscape -remote "openFile(${file})") >& /dev/null

#if this fails, it means that netscape is not running, so start it
if ($status) then
  netscape -no-install file:${file}
endif


#!/usr/bin/tcsh

if ($#argv != 1) then
    echo "Usage: $0 file.doc"
    exit 1
endif

set source = $argv[1]

#Generate a unique html filename (/tmp/scriptname.pidnum.html)
set com = $0
set temp = /tmp/$com:t.$$
set html = $temp.html

mswordview -o $html $source
if ((!(-s $html)) | ($status)) then
    echo "$0: failed to generate HTML file"
    exit 1
endif

#File exists and is of length > 0, so open it
nsopen $html

#I do NOT remove the html file so that the user
#can click on the "Back" button without generating
#a "file not found" error

exit 0

Reply to: