use strict; use Win32::OLE; use Win32::OLE::Const 'Microsoft word'; my $word = Win32::OLE->new('word.Application', ''); $word->{'Visible'} = 1; my $wordtarget = $word->Documents->add() || die("Unable to open document ", Win32::OLE->LastError()); my $range = $wordtarget->{Content}; $range->InsertAfter("InsertAfter method"); $wordtarget->TypeText("typetext method"); $range->TypeText("typetext method");