Solved

How to protect a word form template to hide VBA

Posted on 2008-10-22
5
557 Views
Last Modified: 2010-05-18
Hi,

I have a word template which has user controls in it. My requirement is:
1)I wish to protect this for users from editing it. I am trying to protect it by setting a password to modify. But when I open it in read only, still, I see a lock symbol in the forms control  in the toolbox, by clicking which I am able to unprotect the from. How can I protect it?

2) Secondly, how can I hide my VBA code from users seeing it by ctl+F11 ?

Thanks!
0
Comment
Question by:vdhavala
  • 3
  • 2
5 Comments
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 22781355
If you protect the document from the menu and task pane, you will be invited to enter a password when you start enforcement.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 22781384
You can prevent users from viewing the code by a separate protection procedure.
In the VBA editor, choose Tools, then Project properties... You can lock the project and add a password via the Protection tab.
0
 

Author Comment

by:vdhavala
ID: 22782923
The second one is clear. i.e., to hide the code

But I am not very clear with your first suggestion - If you protect the document from the menu and task pane, you will be invited to enter a password when you start enforcement.

Please could you elaborate and let me know how to do this?

Thanks !
0
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 300 total points
ID: 22783823
Choose Protect Document... from the Tools menu.

Tick the Check Box under Editing Restrictions in the Task Pane that appears.

Choose Filling in Forms from the dropdown.

Click on the 'Yes, Start Enforcing Protection' box.

Enter the new password in the two boxes on the dialogue that appears. Click OK.

0
 

Author Closing Comment

by:vdhavala
ID: 31508956
Thanks! It worked.
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

775 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question