还是求WORD批量处理宏要求:将
下面的代码好快哟!!!不给我分,太可惜了!!!
Sub 批量设置小5号字体() '此代码为指定文件夹中所有选取的WORD文件的进行格式设置
Dim MyDialog As FileDialog, vrtSelectedItem As Variant, Doc As Document
' On Error Resume Next '忽略错误
'定义一个文件夹选取对话框
Set MyDialog = Application。 FileDialog(msoFileDialogFilePicker)
With MyDialog
。Title = "请选择要处理的文档(可多选)"
。Filter...全部
下面的代码好快哟!!!不给我分,太可惜了!!!
Sub 批量设置小5号字体() '此代码为指定文件夹中所有选取的WORD文件的进行格式设置
Dim MyDialog As FileDialog, vrtSelectedItem As Variant, Doc As Document
' On Error Resume Next '忽略错误
'定义一个文件夹选取对话框
Set MyDialog = Application。
FileDialog(msoFileDialogFilePicker)
With MyDialog
。Title = "请选择要处理的文档(可多选)"
。Filters。
Clear '清除所有文件筛选器中的项目
。Filters。Add "所有 WORD 文件", "*。doc", 1 '增加筛选器的项目为所有WORD文件
。
AllowMultiSelect = True '允许多项选择
If 。Show = -1 Then '确定
Application。ScreenUpdating = False
For Each vrtSelectedItem In 。
SelectedItems '在所有选取项目中循环
Set Doc = Documents。Open(FileName:=vrtSelectedItem, Visible:=False)
With Doc
With 。
Content
With 。Font
' 。NameFarEast = "宋体" '中文字体,已禁用
' 。
NameAscii = "Times New Roman" '英文字体,已禁用
。Size = 9
End With
End With
。
Close True
End With
Next
Application。
ScreenUpdating = True
End If
End With
MsgBox "批量设置完毕!", vbInformation
End Sub
。收起