2011-05-09 88 views

回答

5

要追加什麼蘭斯說,這裏的這些值合併單元格並設置文本的例子合併的單元格:

Dim myCells As Range 
With ActiveDocument 
    Set myCells = .Range(Start:=.Tables(1).Cell(1, 1).Range.Start, End:=.Tables(1).Cell(1, 3).Range.End) 
    myCells.Select 
End With 

Selection.Cells.Merge 


ActiveDocument.Tables(1).Cell(Row:=1, Column:=1).Range.Text = "Value for Merged Cells" 

注意:此示例中的表有三列兩行

3

您需要訪問表的對象,像

ActiveDocument.Tables(1).Cell(Row:=2, Column:=2).Range.Text 

<some Word.Document here>. 
    Content.Tables(1).Columns.SetWidth <columnwidthhere>, wdAdjustSameWidth