Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Converting Tables to Text.
by Allen Wyatt
(last updated June 26, 2018)
Tables are a great boon to users of Word. When you are working with documents that were created in a different Word processor, however, tables can be nuisances. For instance, one WordTips reader complained that his two-column text created in WordPerfect was converted in Word to tables. He asked for a way to automatically convert all the tables to text, without the need to process each table manually.
The following macro, AllTablesToText, will do the trick. It steps through each table in the current document and converts them all to text, with tabs between columns:
Sub AllTablesToText() Dim Tbls As Long Dim J As Long Tbls = ActiveDocument.Tables.Count For J = Tbls To 1 Step —1 ActiveDocument.Tables(J).ConvertToText Separator:=wdSeparateByTabs Next J End Sub
If you don't want tabs between columns, all you need to do is change the value assigned to the Separator parameter. You can use wdSeparateByCommas, wdSeparateByDefaultListSeparator, or wdSeparateByParagraphs.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (866) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Converting Tables to Text.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
If you get a document from a coworker that has tabs used to line up tabular information, you might want to change that ...Discover More
For some programming needs, it is important to determine the index of an object within a collection of such objects. This ...Discover More
When you transpose information, it is essentially "rotated" in a direction. If you transpose the information in a table, ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.