如果该属性值为 True,则需要密码才能打开指定文档。Boolean 类型,只读。
本示例首先将“kittycat”设置为活动文档的密码,然后显示确认信息。
ActiveDocument.Password = "kittycat" If ActiveDocument.HasPassword = True Then _ MsgBox "The password is set."