Anyway to get Preferredwidth for a table with merged columns?

J

JWS315

Is there ANYWAY to determine the width of a table that has merged columns?
Jean-Guy showed a way to get the table width for a table without merged
columns, however I have many users that like to create tables with merged
columns.

The preferredwidth property returns 99999 if the table is merged and the
column width returns an error.

I am copy and pasting the merged table as a nested table and I need to know
if the table is wider than 1 column in page layout to auto size the new table
to either fit in 1 column or spread it across the whole page.

Jerry
 
S

Stefan Blom

Wouldn't AutoFit work for you?

To make a table fit the width of its container:

<TableObject>.AutoFitBehavior wdAutoFitWindow

And to restore a fixed width:

<TableObject>.AutoFitBehavior wdAutoFitFixed

--
Stefan Blom
Microsoft Word MVP


in message
news:[email protected]...
 

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