in reply to Extract Single Line of Text from Word Document Using OLE

Here's how I did it. I recorded a macro in Word so as to highlight the 4th line, then took the resulting VB script and converted it to perl. Note that I made it open the doc in the background, i.e. not visible, and read-only; and I quit as soon as I'm done getting the data I wanted.
use Win32::OLE; use strict; my $docfile = "C:/file_to_open.doc"; my $w = new Win32::OLE 'Word.Application' or die; $w->{'Visible'} = 0; my $doc = $w->Documents->Open($docfile,0,1,0); $w->Selection->MoveDown({ Unit=>5, Count=>3 }); $w->Selection->EndKey({ Unit=>5, Extend=>1 }); print $w->Selection->Text; $doc->Close(0); $w->Quit(0);
This uses Win32::OLE rather than OLE as yours does; the interfaces look similar enough.