Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Win32::OLE and Word docs "Marked as Final"

by mdamazon (Acolyte)
on Mar 15, 2019 at 13:29 UTC ( [id://1231311]=perlquestion: print w/replies, xml ) Need Help??

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

I have a project where I am re-purposing some older Word docs. I copy the old documents to a new folder, open them, execute a search and replace using Win32::OLE, then save them. That works fine, except those documents that have been "Marked as Final", which I am unable to make changes to. Is there a way in Win32::OLE to 1.) check if the document is marked as final, and if so, 2.) unmark the document. Thanks!
  • Comment on Win32::OLE and Word docs "Marked as Final"

Replies are listed 'Best First'.
Re: Win32::OLE and Word docs "Marked as Final"
by hdb (Monsignor) on Mar 15, 2019 at 14:08 UTC

    The document object has a "Final" property which you can check or set like

    $doc->{Final} = 1;

    to mark the document as final.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-23 11:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found