以下是引用feiwenhai在2005-5-18 10:47:00的发言:
对,我想知道在程序里怎么控制
请参考:
'* +++++++++++++++++++++++++++++
'* Created By I Love You_Word!@ExcelHome 2005-5-18 11:26:42
'仅测试于System: Windows NT Word: 10.0 Language: 2052
'^The Code CopyIn [ThisDocument-ThisDocument]^'
'* -----------------------------
Option Explicit
Sub Example()
On Error Resume Next
With ActiveDocument
If .ProtectionType = wdNoProtection Then
.Protect Type:=wdAllowOnlyFormFields, Password:="123"
ElseIf .ProtectionType <> wdNoProtection Then
.Unprotect "123"
End If
End With
End Sub
'---------------------- |