mhd has asked for the wisdom of the Perl Monks concerning the following question:
the error:use warnings; use strict; use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Word'; my $MYDOC = "C:\\Document and Settings\\mhd\\My Documents"; my $DOCFILE = "$MYDOC\\work\\apifunc.doc"; #open STDERR, ">errlog.txt"; my $document = Win32::OLE->GetObject($DOCFILE) or die("Unable to open +document ", Win32::OLE->LastError()); #close STDERR; open FH,">functionList.cpp"; my $pat='\d{1,2}\.(\s)+(V|v)oid'; my $paragraphs = $document->Paragraphs(); my $par; my $enumerate = new Win32::OLE::Enum($paragraphs); while(defined($par = $enumerate->Next())){ if($par =~ m|$pat| ){ print FH; } } close (FH) or die "can't close :$! \n";
What's wrong? I have no idea how to fix it. Any help is appreciated. Thanks.Unable to open document Win32::OLE(0.1709) error 0x800401ea: "Moniker +cannot open file" after character 0 in "C:\Document and Settings\mhd\My Documents\work\apifunc.doc" at extractfunctionName.pl line 13.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Error opening ms word document
by grizzley (Chaplain) on Mar 05, 2009 at 12:48 UTC | |
by mhd (Novice) on Apr 01, 2009 at 09:30 UTC | |
by grizzley (Chaplain) on May 12, 2009 at 07:53 UTC | |
|
Re: Error opening ms word document
by Anonymous Monk on Mar 06, 2009 at 08:29 UTC |