Home: Perl Programming Help: Win32 Programming Help:
Need help on getting paragraph values from a Word file (Win32::OLE)



kuysal
New User

Jul 31, 2009, 2:15 AM


Views: 8909
Need help on getting paragraph values from a Word file (Win32::OLE)

Hey Guys,

I've newly started coding in Perl and I've some problems while reading lines from word files.

Lets assume that I have a line retrieved from a MS Word file and that is assigned to $prg:

My line format that I want to read in the word file is like:

4.1.12 Speed Heading and Time

I read that line with this code:


Code
 $prg->Range->Text


But it gets only the text inside the line. It doesn't get the level numbers on the left. I need to get the level numbers. I've been looking for a code on the net but unfortunately I couldn't find anything.

Thanks for your further help.


(This post was edited by kuysal on Aug 10, 2009, 1:13 AM)


KevinR
Veteran


Jul 31, 2009, 11:25 AM


Views: 8900
Re: [kuysal] Need help on getting paragraph values from a Word file

What module are you using to read the file?
-------------------------------------------------


kuysal
New User

Aug 10, 2009, 1:11 AM


Views: 8805
Re: [KevinR] Need help on getting paragraph values from a Word file

Sorry for the late response. I use this code to read from the file. I don't know if it's module or not. I hope it helps


Code
	use Win32::OLE; 

my $word = Win32::OLE->new( 'Word.Application', 'Quit' );
my $doc = $word->Documents->Open( "$wd\\$fileName" );


Thanks