怎样在EXCEL的VBA中打开一个WORD文件?

2020-06-02 社会 169阅读
'首先要在vba中引用Microsoft Word 11.0 Object Library
Dim Wdapp As Word.Application
Dim WdDocument As Word.Document
Dim UserFile As String
Private Sub CommandButton1_Click()
Set Wdapp = New Word.Application
UserFile = Wdapp.Path & "\1.doc"
Set WdDocument = Wdapp.Documents.Open("c:\1.doc")
Wdapp.Visible = True
End Sub
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com