Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How to protect a word form template to hide VBA

Posted on 2008-10-22
5
558 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to line 23 53
How to bypass VBA Project password 5 48
save excel in the same active file's folder. 8 20
Index Match Array? 5 32
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
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…
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

839 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