DVCHAL has asked for the wisdom of the Perl Monks concerning the following question:
open(OUTFILE2,">Author_name_extract.txt") or die("Cant open Output fil +e\n"); @filesnames = glob '*.docx'; foreach $count (@filesnames) #Loop till the end is reached { $filename = "D:\\MRJ_BCU\\Perl\\From thejaswini\\doc_read\\$count" +; $document = Win32::OLE -> GetObject($filename); my $app = $document->{Application}; open(OUTFILE1,">File_under_Review.txt") or die("Cant open Output f +ile\n"); print "Extracting Text from $filename...\n"; $paragraphs = $document->Paragraphs(); $enumerate = new Win32::OLE::Enum($paragraphs); while(defined($paragraph = $enumerate->Next())) { $a = $paragraph->{Range}->{Text}; print OUTFILE1 "$a\n"; } close(OUTFILE1); $#document->Close();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: To close the Word Application through WIN::OLE
by james28909 (Deacon) on Dec 12, 2014 at 07:54 UTC | |
|
Re: To close the Word Application through WIN::OLE
by Gangabass (Vicar) on Dec 12, 2014 at 13:28 UTC |