$! view MS Word documents using the antiword program. $ file = p1 $ if file.eqs."" then goto nofile $ dev = f$parse(file,".DOC",,"DEVICE") $ direct = f$parse(file,".DOC",,"DIRECTORY") $ name = f$parse(file,".DOC",,"NAME") $ ext = f$parse(file,".DOC",,"TYPE") $ version = f$parse(file,".DOC",,"VERSION") $ file = dev+direct+name+ext+version $ if f$search(file) .eqs. "" then goto fnf $ mode=0 $ if p2.eqs."PDF" then mode=1 $ if mode.eq.0 $ then $ psfile = "sys$scratch:"+name+".PS" $ pipe antiword -p a4 -i 0 'file' >'psfile' $ if f$search(psfile) .eqs."" then goto nops $ gv 'psfile' $ delete/noconfirm 'psfile'; $ else !PDF output $ pdffile = "sys$scratch:"+name+".PDF" $ define/user sys$output 'pdffile' $ antiword -a a4 -i 0 'file' $ if f$search(pdffile) .eqs."" then goto nopdf $ write sys$output "PDF file ",f$search(pdffile)," produced." $ endif $ exit $nofile: $ write sys$output "wordviewer: no file argument given " $ exit $fnf: $ write sys$output "File not found: ",file $ exit $nops: $ write sys$output "Antiword did not produce a PS file: ",psfile $ exit $nopdf: $ write sys$output "Antiword did not produce a PDF file" $ exit