读书人

怎么用VBA代码实现如上保护文档设置

发布时间: 2013-01-08 14:02:13 作者: rapoo

如何用VBA代码实现如下保护文档设置。
工具->保护文档
用VBA实现如下设置:
1.格式设置限制:不用理
2.编辑限制:
仅允许在文档中进行此类编辑:填写窗体
3.启动强制保护:设置一个密码,如设置为password

上面是office2003的手工操作步骤。不知office2007的又是如何设置的,用VBA实现又是如何的?

谢。
[解决办法]

'Protect the document.
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
End If

读书人网 >VBA

热点推荐