Share via

Word for Mac - Applescript

Anonymous
2018-01-22T08:23:47+00:00

Since version 16.9, Word no longer responds to the following Applescript commands:

get read only recommended of active document

set read only recommended of active document to false

Is there another way to get or set the read only recommended status of a document with Applescript? Or VBA?

Thank you for your help

Microsoft 365 and Office | Word | For home | MacOS

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. Anonymous
    2018-01-22T11:00:37+00:00

    At the moment, either getting or setting (say) ActiveDocument.ReadOnlyRecommended in VBA also causes an error (Named Argument Not Found).

    (Also, trying to set Me.ReadOnlyRecommend to true in a module in "ThisDocument" does not work and the property is not listed in the Properties Windows for the document in the VB Editor).

    Since Word 2016 still pops up the appropriate dialog box when you try to open a readonlyrecommended document, I'm going to guess that this is actually an error in the API (it sounds as if a named parameter is expected), because when you open a read only file via the user interface you still get the appropriate messages. But I really do not know. I have reported this via the smiley mechanism.

    I can't see an obvious mechanism to set the value using VBA and the object model on an open document. I tried inserting an empty ReadonlyRecommended document but that did not work.

    So I reckon the only way at the moment would be to insert/modify the relevant XML element in the document's XML, so the following value appears in the settings part

    How to achieve that in your scenario is a different matter - if you were saving as .xml it probably would not be too hard to open the .xml file as a text file, search for the element and insert it if absent, etc., but working with a .docx would be harder, probably significantly.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments