本帖最后由 pcl_test 于 2017-10-20 15:08 编辑
- 'Set fso = CreateObject("Scripting.FileSystemObject")
- Set wordapp=CreateObject("Word.application")
- wordapp.Visible=True '界面可见
-
- AcceptRevisions("D:\test.doc") '批量操作自行解决
-
- wordapp.Quit
-
- Function AcceptRevisions(file)
- Set doc = wordapp.Documents.Open(file)
- If doc.ProtectionType=-1 Or doc.ReadOnly=false Then
- doc.Revisions.AcceptAll
- 'doc.AcceptAllRevisions
- doc.Save
- End If
- doc.Close
- End Function
复制代码
|