Hi All
I am parsing a word doc using perl. I am using Win32::OLE module for this.
I am able to get the Paragraphs/styles/Text from the word doc. But facing some problem when I am trying to get a Text with Bullets/numbering. It Only displays the text, but i want to get the bullet number also from the text line.
I am not getting the different methods available in Paragraphs(like Range, Style....etc). How do i get the list of methods? Please Help me.
Here is my code :
Thanks & Regards
Pramod
I am parsing a word doc using perl. I am using Win32::OLE module for this.
I am able to get the Paragraphs/styles/Text from the word doc. But facing some problem when I am trying to get a Text with Bullets/numbering. It Only displays the text, but i want to get the bullet number also from the text line.
I am not getting the different methods available in Paragraphs(like Range, Style....etc). How do i get the list of methods? Please Help me.
Here is my code :
Code:
use Win32::OLE;
use Win32::OLE::Enum;
use File::Copy;
use strict;
my $fileName = "C:\\FileName.doc";
my $document = Win32::OLE -> GetObject($fileName);
#Creating a new excel sheet
my $xl_app=Win32::OLE->new('Excel.Application','Quit');
my $paragraphs = $document->Paragraphs();
my $enumerate = new Win32::OLE::Enum($paragraphs);
while(defined($paragraph = $enumerate->Next()))
{
$style = $paragraph->{Style}->{NameLocal};
$text = $paragraph->{Range}->{Text};
$text =~ s/[\n\r]//g;
$text =~ s/\x0b/\n/g;
$text =~ s/\x07//g;
print "\nStyle = $style";
print "\nText = $text";
}
Pramod
Comment