perlquestion
karthik4perl
<P>Hi Monks,<BR>
<BR>
I am writing code for extracting the "Comments" from a "Word" document and displaying it. I am using Win32::OLE.</P>
<P> Please help me with the portions where I am stuck:<BR>
<BR>
1) How can I extract the "PageNumber" from which the comment is placed in the "Word" document?<BR>
2) How to copy all the comments from one "Word" document to another "Word" document using perl? </P>
<P>Here's the code:</P>
<P> use Win32::OLE qw/ in /;</P>
<P> my $Word;<BR>
my $Doc;<BR>
my $file;<BR>
my $file1 = "c:\some.doc";</P>
<P> $Word = Win32::OLE->new('Word.Application', 'Quit');<BR>
$Doc = $Word->Documents->Open($file1);<BR>
<BR>
foreach my $c (in $Doc->{Comments}) {<BR>
my $tag = $c->{Initial} . $c->{Index};</P>
<P> print b($c->{Scope}{Text})," ",$tag,"-",$c->{Range}<BR>
{Text},br,br;<BR>
}</P>
<P>Thanks<BR>
(karthik4perl)</P>