只知道如下定义:
Dim Wordobj As Object
Set Wordobj = CreateObject("Word.Basic")但不知道接着该怎么写入数据 ???

解决方案 »

  1.   

    你需要引用 Microsoft Word 10.0 Object Library 对象库在工程中。然后在程序里定义Dim WordApp As Word.Application
    Dim WordDoc As Word.Document
      

  2.   

    我是这样写的:
    Dim wrdApp As Word.Application
    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"
        .ActiveDocument.Content.Text = "success"
      End With但是最后显示了两个word,第一是个空的,第二个显示了:success,把"Hi"和"This is a test example"覆盖掉了。怎么回事???我的需求:我现在要显示成类似表格的形式,有多行,但只有两列。
    这样的要求进行写的话该怎么写 ?
      

  3.   

    .ActiveDocument.Content.Text = "This is a test example"& vbcrlf 这就有回车了啊