http://www.perlmonks.org?node_id=477289


in reply to Pull all text from msword document

#!/bin/perl5 use strict; use warnings; use Win32::OLE; my $w = Win32::OLE->GetActiveObject('Word.Application'); my $d = $w->ActiveDocument; my $paras = $d->Paragraphs; my @word; foreach my $para (in $paras) { my $text = $para->Range->{text}; chop $text; # remove /r push @word, $text; } print "$_\n" for @word;

Replies are listed 'Best First'.
Re^2: Pull all text from msword document
by boat73 (Scribe) on Jul 22, 2005 at 17:19 UTC
    Perfect, tyhanks so much. I have also added the warnings and strict to the code. Thanks to all those that responded.