#1
|
|||
|
|||
creating a content control that is password protected
hi
I am working on this project where my supervisor wants me to add a content control that triggers a password check using vba. is there anyway this can be done? |
#2
|
|||
|
|||
You are best off using Word's built-in security rather than trying to write something. However, you can use a MacroButton Field to run a macro that would simulate a password check. You could store the password as a document variable and close the document if the proper response is not given. This is far from the security offered by Word's password to open or even its password to edit.
You can protect a document by restricting editing and requiring a password to edit protected portions. |
#3
|
||||
|
||||
You can trap the OnEnter event for a content control. This macro would fire every time you enter a Content Control and you can simply test the properties of the CC so that if someone enters that particular one, password check part of the macro can run.
See https://msdn.microsoft.com/en-us/lib.../ff196332.aspx
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#4
|
||||
|
||||
The problem with these methods is that they require the use of macros. You cannot force a user to run a macro.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
#5
|
||||
|
||||
That's true Graham but the original poster said 'my supervisor wants me to add a content control that triggers a password check using vba'.
They will find it hard to come up with a different solution that uses vba but doesn't force a user to run a macro
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
#6
|
||||
|
||||
Exactly - which is why the aim is not viable.
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Clicking the selected Content Control checkbox returns wrong control in vba event | DougsGraphics | Word VBA | 2 | 06-24-2015 07:31 AM |
Deleting a table from a content control -- preserving the content control | BrainSlugs83 | Word Tables | 8 | 11-14-2013 03:06 AM |
Password protected file no longer offers password dialog on Open | htaylor | Word | 0 | 10-15-2013 12:35 PM |
Creating a plain text content control for every instance of a word or phrase | RobsterCraw | Word VBA | 16 | 11-20-2012 03:25 PM |
Password Protected Files | gurp99 | Word | 0 | 08-17-2010 03:30 PM |