Measuring height of text and graphics to fill page-length tables

B

Benjamino5

Hi,

I know there was another post recently about filling tables and measuring,
but this is different.

I have hundreds of pages of math problems that must be laid out in two
columns--using tables. I cannot use section breaks and Word's columns feature
(because our other tools rely on tables--it's a long story).

What I want to do is write a macro that will create a page-long table with
two columns (one cell in each column)--that's easy. Then the macro should
copy a range of text, mixed with MathType objects and pictures, and paste
that range into one cell (one column) and then do the same for the other
column. Then repeat.

The trick is being able to figure out how much text, objects, and pictures
can fit into each (page-long) cell of the table. There are different styles
(headings and such) in the text, so I can't estimate line height in any
reasonable way. Similarly, the graphics and MathType may be any height, from
tiny to nearly page-long.

Any thoughts on how to approach this? Thanks a lot!
 
J

Jezebel

Try playing around with the Rectangles and Lines collections within the Page
object. This is a newish feature, not much used, and with documentation that
is lousy even by Microsoft standards, but worth a little experimentation for
your purposes. Create a test page, then look at

activedocument.ActiveWindow.ActivePane.Pages(1).Rectangles

The idea is that the page is broken up into 'rectangles' (columns, header,
footer, etc), each of which is broken up into discrete 'lines' that
completely encompass a block of content. The properties of these should
provide the information (position, width, height) needed to render the page
graphically. It might provide a quick way to determine the dimensions of
your various objects.

Good luck.
 
B

Benjamino5

Jezebel,

Thanks for the tips! Unfortunately, my office is stuck in Word 2000, which
has neither the Rectangle object nor even the Page object.

But I will be getting a new computer with Office 2003 in a couple of
weeks--I'll hold off on this project until then, and at that point, I'll
follow your suggestions.

Ben
 

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