#!/bin/perl5 use strict; use warnings; use Win32::OLE; my $w = Win32::OLE->GetActiveObject('Word.Application'); my $d = $w->ActiveDocument; my $paras = $d->Paragraphs; foreach my $para ( in $paras ) { my $style = $para->Style->{ NameLocal }; my $text = $para->Range->{ text }; print "$style\t$text\n" }