1、vb如何操作word中的表格,,,比如合并任意两个我指定的单线格。
2、如何控制我现在输入的内容的位置。也就是在我指定的位置输入相应内容。
   比如,我想在tables(1)中的row(1)、column(3)处输入文字,我应该怎么做?
   还有,我想在这个表下边空白的地方输入文字,,应该怎么做?
   我现在最困挠的就是不知道怎么控制,想输入内容的位置。请指教。谢谢!

解决方案 »

  1.   

    .Tables(1).Rows(1).Cells(3).Range.insertBefore "文字"
      

  2.   

    Private Sub Command1_Click()
        Dim i%, j%
        Dim ow As Object
        Dim od As Object
        Dim ot As Object
        Dim oc As Object
        Set ow = CreateObject("word.application")
        Set od = ow.documents.Add
        ow.Visible = True
        Set ot = od.Tables.Add(od.Range, 3, 4)
        For i = 1 To ot.rows.Count
            For j = 1 To ot.Columns.Count
                ot.Cell(i, j).Range.InsertBefore i * j
            Next j
            SendKeys "{Down}"
        Next i
        ow.Selection.InsertBefore "new text "
    End Sub