in reply to Re: Win32 Word behaving strangely
in thread Win32 Word behaving strangely
use strict; use Win32::OLE qw( in ); use Win32::OLE::Const 'Microsoft Word'; my $filename = 'E:\test.doc'; my $word = Win32::OLE->new('Word.Application', 'Quit'); my $doc = $word->Documents->Open($filename) || die("Unable to open doc +ument ", Win32::OLE->LastError()); my $nwords = $doc->Words->Count; my @wordtext; my @wordcolor; my $starttime = time; my @items = in $doc->Words->Items; for(my $i = 1; $i <= $nwords; $i++) { $wordcolor[$i] = $items[$i]->HighlightColorIndex; $wordtext[$i] = $items[$i]->Text; }
and @items comes back null.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Win32 Word behaving strangely
by vkon (Curate) on Jul 28, 2006 at 21:07 UTC | |
|
Re^3: Win32 Word behaving strangely
by vkon (Curate) on Jul 28, 2006 at 21:19 UTC |