Table.ConvertToText (Word)

Converts a table to text and returns a Range object that represents the delimited text.

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.

ConvertToText (Separator, NestedTables)


Dim tableTemp As Table 
Dim rngTemp As Range 
 
Set tableTemp = ActiveDocument.Tables(1) 
Set rngTemp = _ 
 tableTemp.ConvertToText(Separator:=wdSeparateByParagraphs) 
 
rngTemp.ListFormat.ApplyListTemplate _ 
 ListTemplate:=ListGalleries(wdBulletGallery).ListTemplates(1)

Arguments

Optional arguments

The following arguments are optional

Separator (String) - The character that delimits the converted columns (paragraph marks delimit the converted rows). Can be any WdTableFieldSeparator constants.

NestedTables (WdTableFieldSeparator) - True if nested tables are converted to text. This argument is ignored if Separator is not wdSeparateByParagraphs. The default value is True.


Possible values are

wdSeparateByCommas A comma.
wdSeparateByDefaultListSeparator The default list separator.
wdSeparateByParagraphs Paragraph markers.
wdSeparateByTabs A tab.