Option Explicit
Sub UnProtectAllDocFiles()
On Error Resume Next
Const strRootPath = "D:\123\123"
Const strPassword = "111222"
Dim oDoc As Document
Dim fso, oFolder, oFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set oFolder = fso.GetFolder(strRootPath)
For Each oFile In oFolder.Files
Set oDoc = Documents.Open(FileName:=oFile.Path, PasswordDocument:=strPassword)
oDoc.Saved = False
oDoc.SaveAs2 FileName:=oFile.Path, Password:="", WritePassword:=""
oDoc.Close
Next
MsgBox "完成!"
End Sub
批量去除word密码保护
最新推荐文章于 2023-11-06 11:34:45 发布