How to protect (via vba) vsdm shapes from changes by users who have no access to Developer tab
Posted on 2015-02-10
My vsdm files are hidden and opened by selecting file name(s) listed in an excel sheet.
The vsdm files have several pages and many shapes, including 'intelligent' multi-shapes, all of which are derived from Template Masters in Stencils.
I want one class of user to have access to view the pages of vsdm files but to edit nothing.
However, I'm not keen on publishing pdf or web pages.
When a protected version of an editable vsdm file is made for 'view-only', it will likely be a temporary file: to be copied (on demand) from the edited version, set to 'protected', viewed by the user, and then deleted - so it never gets back into my bank of editable drawings.
My projected solution is to create a Visio.Document shapesheet variable: "User.ReadOnly", value 1 being 'protected'; 0 being 'unprotected'.
Then, via the shapesheets of every shape Master, reference the relevant 'lock..' cells within the 'shape protection' section to = DocumentSheet.Cells("User.ReadOnly").
This seems straight forward, but I'm looking before I leap. Are there gotchas waiting down the line for me? - Perhaps by referencing all of the Protection variables to DocumentSheet.Cells("User.ReadOnly") ? Or perhaps quite different solutions?