Share via

Convert multiple tables to text?

Anonymous
2013-01-28T22:22:52+00:00

I have numerous Words documents in which the images were put inside single-cell tables. Is there an automated way to convert all these tables to text?

Thanks,

pjs

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Doug Robbins - MVP - Office Apps and Services 323.1K Reputation points MVP Volunteer Moderator
2013-01-28T22:30:28+00:00

You could use a macro containing the following code to convert all of the tables in a single document

Dim i As Long

With ActiveDocument

    For i = .Tables.Count To 1 Step -1

        .Tables(i).ConvertToText

    Next i

End With

To convert all of the tables in all of the documents in a folder, you could modify the code in the

article "Find & ReplaceAll on a batch of documents in the same folder” at:

http://www.word.mvps.org/FAQs/MacrosVBA/BatchFR.htm

by substituting the above code for the replace routine in the code in that article.

Was this answer helpful?

6 people found this answer helpful.
0 comments No comments

Answer accepted by question author

Anonymous
2013-01-28T22:29:56+00:00

Sub ScratchMacro()

'A basic Word macro coded by Greg Maxey

Dim oTbl As Word.Table

For Each oTbl In ActiveDocument.Tables

  If oTbl.Range.Cells.Count = 1 Then

    oTbl.ConvertToText

  End If

Next oTbl

End Sub

See: http://gregmaxey.mvps.org/word_tip_pages/installing_employing_macros.html for instructions to employ the VBA code provided above.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2016-12-01T16:50:03+00:00

    This is one of the most helpful things I have ever found on the web.  A thousand thanks!!

    Was this answer helpful?

    0 comments No comments