Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Benjamino5 - 02 Nov 2006 21:11 GMT
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!
Jezebel - 03 Nov 2006 00:08 GMT
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.

> Hi,
>
[quoted text clipped - 21 lines]
>
> Any thoughts on how to approach this? Thanks a lot!
Benjamino5 - 03 Nov 2006 05:04 GMT
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

> 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
[quoted text clipped - 37 lines]
> >
> > Any thoughts on how to approach this? Thanks a lot!

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.