Tables.Add(Range, Int32, Int32, Object, Object) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a Table object that represents a new, blank table added to a document.
public Microsoft.Office.Interop.Word.Table Add (Microsoft.Office.Interop.Word.Range Range, int NumRows, int NumColumns, ref object DefaultTableBehavior, ref object AutoFitBehavior);
abstract member Add : Microsoft.Office.Interop.Word.Range * int * int * obj * obj -> Microsoft.Office.Interop.Word.Table
Public Function Add (Range As Range, NumRows As Integer, NumColumns As Integer, Optional ByRef DefaultTableBehavior As Object, Optional ByRef AutoFitBehavior As Object) As Table
Parameters
- Range
- Range
Required Range object. The range where you want the table to appear. The table replaces the range, if the range isn't collapsed.
- NumRows
- Int32
Required Integer. The number of rows you want to include in the table.
- NumColumns
- Int32
Required Integer. The number of columns you want to include in the table.
- DefaultTableBehavior
- Object
Optional Object. Sets a value that specifies whether Word automatically resizes cells in tables to fit the cells’ contents (AutoFit). Can be either of the following constants: wdWord8TableBehavior (AutoFit disabled) or wdWord9TableBehavior (AutoFit enabled). The default constant is wdWord8TableBehavior.
- AutoFitBehavior
- Object
Optional Object. Sets the AutoFit rules for how Microsoft Word sizes tables. Can be one of the following WdAutoFitBehavior constants: wdAutoFitContent, wdAutoFitFixed, or wdAutoFitWindow. If DefaultTableBehavior
is set to wdWord8TableBehavior, this argument is ignored.