TextToTable

Syntax

TextToTable [.ConvertFrom = number] [, .NumColumns = number] [, .NumRows = number] [, .InitialColWidth = number or text] [, .Format = number] [, .Apply = number]

Remarks

Converts the selected text to a table based on the separator character you specify. If you run TextToTable without any arguments, Word uses tab characters as the separator if there are no commas, or commas if there are no tab characters, or paragraph marks if there are no tab characters or commas, or if there is a mixture of tab characters and commas. The arguments for the TextToTable statement correspond to the options in the Convert Text To Table dialog box (Table menu).

Argument

Explanation

.ConvertFrom

Specifies the character that separates text elements:

0 (zero) Paragraph marks

1 Tab characters

2 Commas

3 Other (the character that appears in the Other box in the Convert Text To Table dialog box)

.NumColumns

The number of columns to create.


Argument

Explanation

.NumRows

The number of rows to create.

.InitialColWidth

The width of the columns in points or a text measurement. If omitted, column width is calculated so that the table stretches from margin to margin.

.Format

One of the predefined formats listed in the Table AutoFormat dialog box (Table menu): 0 (zero) corresponds to the first format listed in the Formats box ("none"), 1 corresponds to the second format, and so on.

.Apply

Specifies which attributes of the format specified by .Format to apply to the table. For a list of attributes and their values, see TableInsertTable.


See Also

TableAutoFormat, TableInsertTable, TableToText