1
打开一个密码保护的Word文档,我需要打开VBA 密码保护的Word文档时它被要求输入密码,如何通过代码打开 代码:在VBA
Dim DPDoc
Dim DPApp
Dim DPPath
DPPath = "C:\MyFolder\PwdProtectdFile.docx"
Set DPApp = CreateObject("word.Application")
' It is asking for the password here
DPDoc = DPApp.Documents.Open(DPPath)
我得到运行时错误 '448' “命名找不到参数” 因此,我更改为 DPDoc = DPApp.Documents.Open(DPPath,Password = YourOwnPassword) 现在它仍在提示输入密码。似乎没有考虑到这一点。任何人都可以请帮忙 –
@udhayakumar:我的不好,因为它似乎应该是'PasswordDocument'而不仅仅是'Password'!查看编辑 – R3uK