CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

Post #1 of 3 (5808 views)
Need help on getting paragraph values from a Word file (Win32::OLE) Can't Post

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

Post #2 of 3 (5799 views)
Re: [kuysal] Need help on getting paragraph values from a Word file [In reply to] Can't Post

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


kuysal
New User

Aug 10, 2009, 1:11 AM

Post #3 of 3 (5704 views)
Re: [KevinR] Need help on getting paragraph values from a Word file [In reply to] Can't Post

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

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives