Import Excel Workbook Tables to Word

W

wwcoop

I am writing a VBA macro
which builds a report in Word.

There are several appendices
that need to be built. The entire
content of the appendices come
from Excel Workbooks.

The Excel Workbooks are composed
almost entirely of tables. The tables
are usually wide - exceeding the
width of a printed page.

I would like to pull these tables
into Word in a way such that they
will be formatted appropriately
to compensate for page size.

What general approach should
I use? How I can programatically
compensate for wide tables being
imported from Word?

Thanks!
 
C

Cindy M -WordMVP-

Hi =?Utf-8?B?d3djb29w?=,

Could these tables possibly break to a new page (number of
rows), or would they be short enough to fit on a single
page? Which version of Word are we discussing?

You basically have two approaches: inserting a Word-type
table, or the Excel table as an embedded OLE-object. The
latter will adjust automatically to the page width, but is
limited to (at most) a single page in height.

There are commands in the Word object model that resize a
word-type table to the page width, but the content could
look rather strange (unless you're also considering
reducing font size?)

What might work best, especially if the user would like
some control before production time, would be to set up a
second worksheet in the workbook that's sized to fit an A4
page (column widths, font-size).
I am writing a VBA macro
which builds a report in Word.

There are several appendices
that need to be built. The entire
content of the appendices come
from Excel Workbooks.

The Excel Workbooks are composed
almost entirely of tables. The tables
are usually wide - exceeding the
width of a printed page.

I would like to pull these tables
into Word in a way such that they
will be formatted appropriately
to compensate for page size.

What general approach should
I use? How I can programatically
compensate for wide tables being
imported from Word?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top