in reply to Re: Win32::OLE word questions
in thread Win32::OLE word questions
sorry, the first line should be #use strict
and the semicolon was exist.
since the program doesnot work that i am still revise it very often,
my end-goal is that
foreach $rate($Word->ActiveDocument->Selection->{Text}){ #get all content of the activedocument
if ($rate =~ /2M/){ #if $rate could match the keyword
print $rate; }} #print it out
$Word->ActiveDocument->Selection->{Text};
$line1 = $Word->Selection->wdline(2)->{Text}; #get or extract all the words of the second line of the active document
pirnt $line1;
i have read win32::ole documentation, but this is the first time i have written the ole word script, i am fairly strange at the ole processing. i know my problem is the method invoking, i have revised more then ten times, i have no idea where the error is.