Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use drawing tools on protected form 1

Status
Not open for further replies.

ps40life

Technical User
Aug 20, 2002
49
0
0
US
Does anyone know how I can use drawing tools on a protected Word form. I have a "graph" area that I want to be able to draw circles, squares, etc. on. I tried to protect only the other sections of the form and I can TYPE in the graph section, but the draw tools are disabled.

Thanks for any suggestions! [bigsmile]
 
Most interesting. You are correct, drawing toolbar is disabled on a protected form, regardless of whether you are trying to do something in a unprotected section.

The ONLY way I could do it was temporarily unprotect, do the drawing then protect again. Strange. Why would they do that, especially in a section that is NOT protected?

Gerry
Painting/Sculpture site:
 
I agree! So, is there any good way to suspend protection, maybe with a macro, so you could use the drawing tools, then re-protect without losing form field data??
[ponder]
 
Sure. If you are the owner of the document you could write a macro that would unprotect and protect again. There are a number of options to do this. It would not affect the form field data.



Gerry
Painting/Sculpture site:
 
I would need to know a little more. If you are the owner of this document, why do you not just unprotect it, do whatever you need to do, and protect it again?

You could get a macro that does those steps - just record it. However, if there is some other complication that requires you to restrict others being able to unprotect (other than just using a password on the protection), then it gets a little more complex.

What exactly is the situation? Is the document protected just to use the forms?

Gerry
Painting/Sculpture site:
 
I was reading your threads and have a similar problem. I'm trying to convert some OLE links in a locked form to text - or lock the field so it isn't updated the next time you open it. I think I have to unlock the form, lock the fields and then relock the form. I will write a macro to do this, but I don't know the syntax to unlock the form! I can't record a macro when the form is locked. Any ideas?
 
Write the macro before you lock the form. Also, if you need to run it from a specific place, use your macro as an exit macro for a formfield.

The following is a generic type macro for protection/unprotection. Assumes: 4 sections, of which Sections 2 & 3 need to be protected as they have formfields, Sections 1 & 4 do not. Note that I tend to make the document I am working on a specific object. Just a habit, as it makes it easier if you are working on multiple documents. The aDoc as Document object is not, strictly speaking, necessary. ActiveDocument.Unprotect (etc.) works as well.

Sub ProtectUnptotect()
Dim aDoc As Document
Set aDoc = ActiveDocument
aDoc.Unprotect Password:=""

' * * * * * * * * * * *
' do what ever you need to do

aDoc.Protect wdAllowOnlyFormFields, Password:=""
Selection.Sections(1).ProtectedForForms = False
Selection.Sections(2).ProtectedForForms = True
Selection.Sections(3).ProtectedForForms = True
Selection.Sections(4).ProtectedForForms = False
Set aDoc = Nothing
End Sub


Hope this helps.


Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top