mdamazon has asked for the wisdom of the Perl Monks concerning the following question:

I want to remove all the comment bubbles in a an MS-Word document using Win32::OLE. When I create a macro to see the VB code behind this operation, no commands are found in the macro. So, if anyone is kind enough to assist, I would like to know how to do this using Win32::OLE (I don't have access to many other modules, BTW). Thank You.

Replies are listed 'Best First'.
Re: Win32:OLE MS-Word comment bubbles
by haukex (Archbishop) on May 24, 2019 at 12:58 UTC

    Pretty much all of VBA can be translated to Win32::OLE calls, so you can use Microsoft's VBA documentation. Some quick Googling brings me to the Document.DeleteAllComments method, and this works for me:

    use Win32::OLE; my $Word = Win32::OLE->GetActiveObject('Word.Application'); $Word->{ActiveDocument}->DeleteAllComments;
Re: Win32:OLE MS-Word comment bubbles
by marto (Cardinal) on May 24, 2019 at 12:58 UTC