karthik4perl has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I am writing code for extracting the "Comments" from a "Word" document and displaying it. I am using Win32::OLE.
Please help me with the portions where I am stuck:
1) How can I extract the "PageNumber" from which the comment is placed in the "Word" document?
2) How to copy all the comments from one "Word" document to another "Word" document using perl?
Here's the code:
use Win32::OLE qw/ in /;
my $Word;
my $Doc;
my $file;
my $file1 = "c:\some.doc";
$Word = Win32::OLE->new('Word.Application', 'Quit');
$Doc = $Word->Documents->Open($file1);
foreach my $c (in $Doc->{Comments}) {
my $tag = $c->{Initial} . $c->{Index};
print b($c->{Scope}{Text})," ",$tag,"-",$c->{Range}
{Text},br,br;
}
Thanks
(karthik4perl)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Regarding the "Comment" object in Perl's Win32::OLE
by rdfield (Priest) on Jan 17, 2005 at 10:20 UTC | |
by Errto (Vicar) on Jan 17, 2005 at 16:41 UTC | |
by rdfield (Priest) on Jan 17, 2005 at 16:51 UTC | |
Re: Regarding the "Comment" object in Perl's Win32::OLE
by jdporter (Paladin) on Jan 17, 2005 at 16:59 UTC | |
Re: Regarding the "Comment" object in Perl's Win32::OLE
by Madams (Pilgrim) on Jan 19, 2005 at 01:47 UTC |