use Win32::OLE::Const 'Microsoft Word'; my $wd = Win32::OLE->GetActiveObject('Word.Application');