Macro: Formular protection off/on

C

Cifly

Hey out there.

I'm not completely sure, that "formular" is spelled as i have done it in
english. But i hope you get the meaning of my question anyway.

I seek a code in word vba, that turns formular protection off and on, by
pression a button placed in the document.

Can anyone help/supply me with this?

Thx in advance
Cifly
 
H

Helmut Weber

Hi Cifly,

"formular" sounds german.
What language are you using?

Private Sub CommandButton1_Click()
With ActiveDocument
If .ProtectionType = wdNoProtection Then
.Protect wdAllowOnlyFormFields ' e.g. (zum Beispiel)
Else
.Unprotect
End If
End With
End Sub


--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top