Table.ConvertToText Method
Word Developer Reference |
Converts a table to text and returns a Range object that represents the delimited text.
Syntax
expression.ConvertToText(Separator, NestedTables)
expression Required. A variable that represents a Table object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
Separator | Optional | Variant | The character that delimits the converted columns (paragraph marks delimit the converted rows). Can be any WdTableFieldSeparator constants. |
NestedTables | Optional | Variant | True if nested tables are converted to text. This argument is ignored if Separator is not wdSeparateByParagraphs. The default value is True. |
Remarks
When you apply the ConvertToText method to a Table object, the object is deleted. To maintain a reference to the converted contents of the table, you must assign the Range object returned by the ConvertToText method to a new object variable. In the following example, the first table in the active document is converted to text and then formatted as a bulleted list.
Visual Basic for Applications |
---|
|
Example
This example creates a table and then converts it to text by using tabs as separator characters.
Visual Basic for Applications |
---|
|
This example converts the table that contains the selection to text, with spaces between the columns.
Visual Basic for Applications |
---|
|
See Also