If I add content controls to a document and then 'group' the controls I get a document where only the controls can be edited. That's good, users will only be able to edit the bits I allow them to edit.
Except, it is trivial to click on the Developer tab and ungroup the controls, whereon the whole doc becomes editable. How to I prevent a user from doing that?
Thanks,
Ken
'locking' a document
-
- Panoramic Lounger
- Posts: 8267
- Joined: 25 Jan 2010, 09:09
- Location: retirement
-
- UraniumLounger
- Posts: 9348
- Joined: 13 Feb 2010, 01:27
- Location: Deep in the Heart of Texas
Re: 'locking' a document
As an American (with tongue firmly in cheek), firearms come to mind.
![Flee :flee:](./images/smilies/flee.gif)
![Fanfare :fanfare:](./images/smilies/fanfare.gif)
![Fanfare :fanfare:](./images/smilies/fanfare.gif)
![Flee :flee:](./images/smilies/flee.gif)
Bob's yer Uncle
Dell Intel Core i5 Laptop, 3570K,1.60 GHz, 8 GB RAM, Windows 11 64-bit, LibreOffice,and other bits and bobs
(1/2)(1+√5) |
-
- Microsoft MVP
- Posts: 1320
- Joined: 24 May 2013, 15:33
- Location: Warminster, PA
Re: 'locking' a document
You can click in any area that isn't in a content control, and click the Properties button -- this gets you the property dialog for the Group control, which has only one option:
Of course, a user who knows about this can click the Properties button and uncheck the option, but that's a bit less likely than knowing to ungroup the document. Unfortunately, the Design Mode button still makes it possible to edit the text between the content controls.
If it's any consolation, it's just as simple (and just as little-known) to remove the protection from a password-protected legacy form. I won't explain it here, but it's easily found on the 'Net.
When that's checked, the Group button is disabled.Of course, a user who knows about this can click the Properties button and uncheck the option, but that's a bit less likely than knowing to ungroup the document. Unfortunately, the Design Mode button still makes it possible to edit the text between the content controls.
If it's any consolation, it's just as simple (and just as little-known) to remove the protection from a password-protected legacy form. I won't explain it here, but it's easily found on the 'Net.
You do not have the required permissions to view the files attached to this post.
-
- Panoramic Lounger
- Posts: 8267
- Joined: 25 Jan 2010, 09:09
- Location: retirement
Re: 'locking' a document
Thank you Jay, I'll investigate further.
Meanwhile, would it be possible to use VBA to hide/remove/disable the Developer tab when the file was opened? I suspect not as that sounds like the sort of thing someone not as nice as me could use within malicious software.
Ken
Meanwhile, would it be possible to use VBA to hide/remove/disable the Developer tab when the file was opened? I suspect not as that sounds like the sort of thing someone not as nice as me could use within malicious software.
Ken
-
- Microsoft MVP
- Posts: 1320
- Joined: 24 May 2013, 15:33
- Location: Warminster, PA
Re: 'locking' a document
That can be done fairly easily...stuck wrote:Meanwhile, would it be possible to use VBA to hide/remove/disable the Developer tab when the file was opened? I suspect not as that sounds like the sort of thing someone not as nice as me could use within malicious software.
![Blackteeth :blackteeth:](./images/smilies/blackteeth.gif)
Download the Office Custom UI Editor Setup zip file from http://openxmldeveloper.org/blog/b/open ... /7293.aspx, extract the MSI file from it, and install it.
Start the editor and use its Open command to open your form document.
Paste the following code into the right-hand side of the editor, and save and close.
Code: Select all
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab idMso="TabDeveloper" visible="false" />
</tabs>
</ribbon>
</customUI>
![Fanfare :fanfare:](./images/smilies/fanfare.gif)
-
- Panoramic Lounger
- Posts: 8267
- Joined: 25 Jan 2010, 09:09
- Location: retirement
Re: 'locking' a document
Jay Freedman wrote:That can be done fairly easily...
![Joy :joy:](./images/smilies/joy.gif)
![ThumbUp :thumbup:](./images/smilies/thumbup.gif)
I've already got the Custom UI Editor.
![ThankYou :thankyou:](./images/smilies/thankyou.gif)
Ken
-
- 5StarLounger
- Posts: 641
- Joined: 10 Jan 2016, 15:56
- Location: Madison, Wisconsin
Re: 'locking' a document
And you are right that it can be malicious, but it is only for that document or template.
Here is a website:
http://gregmaxey.com/word_tip_pages/cus ... _main.html
Here is a book:
http://www.amazon.com/exec/obidos/ISBN= ... heckbookA/
Here is a website:
http://gregmaxey.com/word_tip_pages/cus ... _main.html
Here is a book:
http://www.amazon.com/exec/obidos/ISBN= ... heckbookA/
![Cheers :cheers:](./images/smilies/cheers.gif)
Templates in Microsoft Word
Modifying the QAT
The Importance of Styles in Microsoft Word
-
- Panoramic Lounger
- Posts: 8267
- Joined: 25 Jan 2010, 09:09
- Location: retirement
Re: 'locking' a document
I might have seen the website already as I've created groups and tabs etc in both Word and Excel to provide users with easy access to my (dire but it works) code.Charles Kenyon wrote:Here is a website... ...Here is a book
Thanks,
Ken