Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Pull all text from msword document

by wfsp (Abbot)
on Jul 22, 2005 at 16:57 UTC ( #477289=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://477289]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2020-10-28 06:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (260 votes). Check out past polls.

    Notices?