‘创建word实例
Set oWordApp = CreateObject("Word.Application")
oWordApp.Visible =True
‘添加一个word文档
Set oWordDoc = oWordApp.Documents.Add
oWordApp.SaveAs "C:\test.docx"
oWordDoc.Close
oWordApp.Quit
‘销毁对象引用
Set oWordDoc = Nothing
Set oWordApp = Nothing
时间: 2024-10-29 19:11:16