ITextRange2::InsertTable method (tom.h)

Inserts a table in a range.

Syntax

HRESULT InsertTable(
  [in] long cCol,
  [in] long cRow,
  [in] long AutoFit
);

Parameters

[in] cCol

Type: long

The number of columns in the table.

[in] cRow

Type: long

The number of rows in the table.

[in] AutoFit

Type: long

Specifies how the cells fit the target space.

Return value

Type: HRESULT

If the method succeeds, it returns S_OK. If the method fails, it returns one of the following COM error codes. For more information about COM error codes, see Error Handling in COM.

Return code Description
E_INVALIDARG
Invalid argument.
E_OUTOFMEMORY
Insufficient memory.

Remarks

If the range is nondegenerate, the table replaces the text in the range. The column widths are calculated according to the AutoFit parameter, and the borders are solid black with 0.5 point widths. To change these defaults, use the ITextRange2::GetRow method to obtain an ITextRow interface.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header tom.h
DLL Msftedit.dll

See also

ITextRange2