如何打开WORD文件修改后,关闭WORD文件时将修改内容保存到数据库

解决方案 »

  1.   

    先选择对象库:Microsoft Excel 8.0对象库是相对于Excel的,而 Microsoft Word 8.0 对象库是为Word服务的
    在VB的IDE环境中,从“工程”菜单中选择“引用”,可以看到系统可用的所有库列表。Option ExplicitDim xlsApp As Excel.Application
    Dim wrdApp As Word.ApplicationPrivate Sub Command3_Click()
    Set wrdApp = New Word.Application 
    With wrdApp
    Show Word 
    .Visible = True
    Create New Document
    .Documents.Add
    Add text to the document
    .ActiveDocument.Content.Text = "Hi"
    .ActiveDocument.Content.Text = "This is a test example"
    End With
    End Sub