in reply to Extract Single Line of Text from Word Document Using OLE
This uses Win32::OLE rather than OLE as yours does; the interfaces look similar enough.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);
|
|---|