在工程->引用中选中 Microsoft Word XX.XX Object Library
即可引用Word
Dim AppWord As New Word.Application
即可使用WORD
例如
Dim xDoc As Document
Dim xRange As Range
AppWord.ShowMe
AppWord.Visible = True
Set xDoc = AppWord.Documents.Open(App.Path + "doc1.doc") 作者:
飞翔的叶子 时间: 2005-5-25 21:48
Private Sub cmddy_Click()
Dim mWord As Word.Application
Dim mDoc As Word.Document
Set mWord = New Word.Application
mWord.Visible = True
Set mDoc = mWord.Documents.Open("D:试卷.doc") mDoc.ActiveWindow.Selection.InsertAfter txtFile.Text
End Sub
我的程序是这样就的能出来
但是本次生成的试卷还累加有上次生成的试卷
InsertAfter txtFile.Text是插入的吧
我想在插入本次试卷之前把Word文档中上次的试卷清空
怎么操作啊 作者:
Nothing 时间: 2005-5-26 20:06