Sub CreateWord()
Dim wordApp As word.Application
Application.StatusBar = "正在创建。。。"
Set wordApp = New word.Application
With wordApp
.Visible = True
Application.StatusBar = "正在创建word"
.Documents.Add
.ActiveDocument.Paragraphs(1).Range.InsertBefore ("测试文档")
Application.StatusBar = "正在保存"
.ActiveDocument.SaveAs ("D:\work\test.docx")
Application.StatusBar = "正在退出"
.Quit
End With
Set wordApp = Nothing
Application.StatusBar = False
End Sub
Sub CreateWord()
Dim wordApp As Word.Application
Application.StatusBar = "正在创建。。。"
Set wordApp = New Word.Application
With wordApp
.Visible = True
.Application.StatusBar = "正在创建word"
.Documents.Add
.ActiveDocument.Paragraphs(1).Range.InsertBefore ("测试文档")
.Application.StatusBar = "正在保存"
.ActiveDocument.SaveAs ("D:\work\test.docx")
.Application.StatusBar = "正在退出"
.Quit
End With
Set wordApp = Nothing
Application.StatusBar = False
End Sub