From: "Rob Dixon" <[EMAIL PROTECTED]> To: "jon sof" <[EMAIL PROTECTED]>,<[EMAIL PROTECTED]> Subject: Re: problems on opening a word document Date: Wed, 17 Sep 2003 11:04:10 +0100
jon sof wrote:
>
> >From: "Rob Dixon" <[EMAIL PROTECTED]>
> >To: "jon sof" <[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
> >Subject: Re: problems on opening a word document
> >Date: Wed, 17 Sep 2003 09:44:34 +0100
> >
> >jon sof wrote:
> >
> > > I use the system() to open the word document. It works on
> > > a win98 system but not on another similar machine.
> > >
> > > Both machines uses win98.
> > >
> > > What is the problem? It getting annoying.
> >
> >It is likely to be because your file associations are not
> >set up correctly. Check whether double-clicking on a .doc
> >file in Windows Explorer starts Word correctly.
> >
> >You should fix this by reinstalling Word, but for the
> >purposes of your Perl program you could run winword.exe
> >explicitly with the .doc file as a parameter.
>
> That's exactly what i am doing.
>
> $winword_path="c:/progra~1/micros~1/office/winword";
>
> $doc="docs/file.doc";
>
> system(1,$winword_path,$doc);
>
> It works great under a win98 system but not on another win98. It drives me
> mad.
>
> Both machines are equipped with the Office 97.
Then all I can think of is to check that the paths are correct. Don't forget that with a relative path for the document you have to be running the script from the right location.
A quick check before the 'system' call wouldn't do any harm:
die "Unable to find Word" unless -e $winword_path; die "Unable to find document" unless -e $doc;
but note that you'll have to put the '.exe' on the 'winword' filename.
On the machine where it isn't working, does Word start without the document or is nothing happening at all?
HTH,
Rob
I always put the .exe .Nothing happening at all when i run the script on the specific machine
_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail
_______________________________________________ ActivePerl mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
