Thursday, January 24, 2008

Copy Tables into a New Document

In Microsoft Word, use the macro to copy a document's tables into a new document. In Word, create the macro like so.

Open the Macros dialog box (Tools >Macro >Macros . . . ). Type CopyTablesIntoNewDocument into the "Macro name:" field, set "Macros in:" to Normal.dot, and click Create.

A window will open where you can enter the macro's code. It already will have two lines of code: Sub CopyTablesIntoNewDocument() and End Sub. You don't need to duplicate these lines.

You can download the code from http://www.pdfhacks.com/copytables/:

Run this macro from Word by selecting Tools >Macro>Macro . . . , selecting Copy Tables Into New Document, and clicking Run. A new document will open that contains all the tables from your current document. It will also include the paragraphs immediately before and after each table. This feature was added to help readers find the table they want. Modify the macro code to suit your requirements.

0 comments: