请问如何用VBA批量修改word的文档属性

我现在有一批文档,都在一个文件夹里面,如何使用VBA代码来添加文档属性,例如所有的word文档都添加以下内容。

第1个回答  2015-05-13
Sub test()
FName = Dir("D:\Downloads\*.doc")
Do While FName <> ""
Documents.Open FileName:="D:\Downloads\" & FName

ActiveDocument.BuiltInDocumentProperties("Title") = "标题"

On Error Resume Next
ActiveDocument.CustomDocumentProperties("myTitle").Delete
Err.Clear
On Error GoTo 0

Documents(1).CustomDocumentProperties.Add _
Name:="myTitle", LinkToContent:=False, Value:="我的标题", _
Type:=msoPropertyTypeString
ActiveDocument.Save
ActiveDocument.Close

FName = Dir
Loop
End Sub追问

这个属性没有去除完啊

相似回答