- 论坛徽章:
- 0
|
i want to extract some words from MS doc file, then i wrote the codes as following
use Win32::OLE; # Object Linking and Embed
use Win32::OLE::Const 'Microsoft Word'; # Defines constants word k
my $Word = Win32::OLE->;GetActiveObject('Word.Application') || Win32::OLE->;new('Word.Application', 'Quit');
$a= $Word->;Selection->;Tables(1)->;Cell(2,2)->;Range->;{Text};
print $a;
above codes worked and could get the text i need.
so i thought
$a= $Word->;Selection->;wdline(1)->;Range->;{Text};
could work as well, but seemed the wdline(1) is a undefined value, i have been checking perl\html\OLE-Browser about the ole value, but have not work out the problems yet. |
|