如果活动文档没有设置密码以防修改文档,则本示例将“secret”设置为该文档的写权限密码。

Set myDoc = ActiveDocument
myDoc.WritePassword = "secret"