http://www.perlmonks.org?node_id=1231425


in reply to Re: Win32::OLE and Word: accessing all headers and comments
in thread Win32::OLE and Word: accessing all headers and comments

I was facing a similar issue and your code sample was just the thing I needed. For my system (Windows 10 -- Office 2016) I had to make Win32::OLE::Const more generic, and I added "close" and "quit" to close the document and end MS Word. Thank you poj for the sample code.
use Win32::OLE::Const "Microsoft Office .* Object Library"; # Close document $Doc->Close(); undef $Doc; # Close MS Word $Word->Quit(); undef $Word;

"It's not how hard you work, it's how much you get done."