|
好的 非常感谢老师的指点
再请教下 word中VBA遍历目录子文件也是一个方法吗?下面代码是word中.doc文件批量转.docx, 还是想让子目录中的.doc文件一次性转换,这个怎么加遍历代码,感谢感谢!
Sub doc2docx()
Dim myDialog As FileDialog, oFile As Variant
Set myDialog = Application.FileDialog(msoFileDialogFilePicker)
With myDialog
.Filters.Clear
.Filters.Add "所有 WORD97-2003 文件", "*.doc", 1
.AllowMultiSelect = True
If .Show = -1 Then
For Each oFile In .SelectedItems
With Documents.Open(oFile)
.ComputeStatistics (wdStatisticPages)
.SaveAs FileName:=oFile + "x", FileFormat:=wdFormatXMLDocument
.Close
End With
Next
End If
End With
End Sub
|
|