Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Win32:OLE MS-Word comment bubbles

by mdamazon (Acolyte)
on May 24, 2019 at 12:50 UTC ( [id://11100460]=perlquestion: print w/replies, xml ) Need Help??

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11100460]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (None)
    As of 2024-04-25 00:51 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found