已知原密码,使用vb2010,word和excel用2003或2013均可,求可更改word和excel文件密码的代码。
已找到方法:
先用一些代码打开文档(略),然后:
myDoc.SetPasswordEncryptionOptions(PasswordEncryptionProvider:="Microsoft RSA SChannel Cryptographic Provider", _
PasswordEncryptionAlgorithm:="RC4", PasswordEncryptionKeyLength:=56 _
, PasswordEncryptionFileProperties:=True)
myDoc.Password = "12348"
谢谢各位!