Cell(intX, intY).Range.InsertAfter "Cell: R" & intX & ", C" & intY This example adds a table with three rows and five columns to a new document and then inserts data into each cell in the table. MyRange.Collapse Direction:=wdCollapseEndĪ Range:=MyRange, NumRows:=6, _ This example adds a new, blank table with six rows and ten columns at the end of the active document Set MyRange = ActiveDocument.Content Set myRange = ActiveDocument.Range(0, 0)Ī Range:=myRange, NumRows:=3, NumColumns:=4 This example adds a blank table with three rows and four columns at the beginning of the active document. Can be one of the WdAutoFitBehavior constants. Sets the AutoFit rules for how Word sizes tables. The default constant is wdWord8TableBehavior.
Can be either of the following constants: wdWord8TableBehavior (AutoFit disabled) or wdWord9TableBehavior (AutoFit enabled). Sets a value that specifies whether Microsoft Word automatically resizes cells in tables to fit the cells' contents (AutoFit). The number of columns you want to include in the table. The number of rows you want to include in the table. The table replaces the range, if the range isn't collapsed. The range where you want the table to appear. A variable that represents a ' Tables' collection. Add ( Range, NumRows, NumColumns, DefaultTableBehavior, AutoFitBehavior)Įxpression Required. Returns a Table object that represents a new, blank table added to a document.