Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-20-2015, 01:28 AM
kawtharz kawtharz is offline creating a content control that is password protected Windows 7 32bit creating a content control that is password protected Office 2013
Novice
creating a content control that is password protected
 
Join Date: Aug 2015
Posts: 3
kawtharz is on a distinguished road
Default 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?
Reply With Quote
  #2  
Old 08-20-2015, 09:36 AM
Charles Kenyon Charles Kenyon is offline creating a content control that is password protected Windows 8 creating a content control that is password protected Office 2013
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,081
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

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.
Reply With Quote
  #3  
Old 08-20-2015, 08:29 PM
Guessed's Avatar
Guessed Guessed is offline creating a content control that is password protected Windows 7 32bit creating a content control that is password protected Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
  #4  
Old 08-20-2015, 09:33 PM
gmayor's Avatar
gmayor gmayor is offline creating a content control that is password protected Windows 7 64bit creating a content control that is password protected Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
  #5  
Old 08-20-2015, 10:03 PM
Guessed's Avatar
Guessed Guessed is offline creating a content control that is password protected Windows 7 32bit creating a content control that is password protected Office 2010 32bit
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

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
Reply With Quote
  #6  
Old 08-21-2015, 12:50 AM
gmayor's Avatar
gmayor gmayor is offline creating a content control that is password protected Windows 7 64bit creating a content control that is password protected Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating a content control that is password protected Clicking the selected Content Control checkbox returns wrong control in vba event DougsGraphics Word VBA 2 06-24-2015 07:31 AM
creating a content control that is password protected 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 content control that is password protected 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

Other Forums: Access Forums

All times are GMT -7. The time now is 08:56 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft