Centering Table in Frame

M

Mike

I have a macro that inserts a selected table and its
caption in a frame and places it either at the top or
bottom of the page. The table, created through a
predefined table style, is centered. However when the
table is placed in the frame, it is flushed left although
the table properties shows that centered is still
selected. (The frame stretches the length of the margin.)
The caption is still centered. Manually selected center
from the table properties does nothing either. How can I
center the table within the frame?

Thanks for any help
 
W

Word Heretic

G'day "Mike" <[email protected]>,

Might be easier to use the headers and footers areas for the insert.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Mike reckoned:
 
G

Guest

This is not possible as there are already items in the
header/footer, and since the margins are carefully set.
Can a table not be centered in a frame like other
paragraph styles?
 
W

Word Heretic

G'day <[email protected]>,

No, you set the left indent of the frame to make the table APPEAR
centered. You can select a row and use selection.information(WOW!) to
calc the width, add the pt width of the borders, add a pt for the
table layout itself. Subtract that from page width, divide by two,
thats your frame indent.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice
 
G

Guest

I see. I have two problems however.

First, even though the widthrule property of the frame is
set to wdFrameAuto, the frame stretches the length of the
margin rather than the lenth of the table (I'm not sure
why).

Second, I can generally see how you can calculate the
width of the of the table using either
wdHorizontalPositionRelativeToPage or
wdHorizontalPositionRelativeToTextBoundary, but actually
doing it, and using it to set the left indent, is a
little beyond my capability.

The first problem I think is not important because
instead of setting the left boundary of the frame to the
page I can set the left boundary of the table in the
frame.

Yet that still leaves me with the second problem.
..
 

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