Making Nested Tables Fit A Page

B

bhartman33

Hi, Everyone.

I've got a process in place for producing Word charts. The problem I'm
having is that these charts need to fit on a landscaped page, and
because of the nested tables in one column, when I go into Table
Properties and adjust the width, it doesn't do anything, because the
one column prevents the table from being narrowed that way. Is there
an automatic way to adjust the whole table at once (including the
nested tables) so that the table fits on one page? Thanks in advance.
:)
 
J

Jean-Guy Marcil

(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :
Hi, Everyone.

I've got a process in place for producing Word charts. The problem
I'm having is that these charts need to fit on a landscaped page, and
because of the nested tables in one column, when I go into Table
Properties and adjust the width, it doesn't do anything, because the
one column prevents the table from being narrowed that way. Is there
an automatic way to adjust the whole table at once (including the
nested tables) so that the table fits on one page? Thanks in advance.
:)

Sorry, but I think that as is, your post is difficult to comprehend.

You start mentioning a chart, but finish with a table. Which is it?
Also, you write:
"the nested tables in one column"
what nested tables? How did they get there? Which column of which table? I
thought you were writing about a chart?

Finally, you posted in a group dealing with programming Word (VBA= Visual
Basic for Applications), are you asking asking about code or a direct
interaction in the document?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
B

bhartman33

Jean-Guy Marcil said:
(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :


Sorry, but I think that as is, your post is difficult to comprehend.

You start mentioning a chart, but finish with a table. Which is it?
Also, you write:
"the nested tables in one column"
what nested tables? How did they get there? Which column of which table? I
thought you were writing about a chart?

Finally, you posted in a group dealing with programming Word (VBA= Visual
Basic for Applications), are you asking asking about code or a direct
interaction in the document?

Salut, Jean-Guy.

Sorry about being confusing. I was using chart and table
interchangeably, which I shouldn't have. I'm actually dealing with a
table in a Word doc. The table's third column contains a nested table
in each row. It's this column that I'm trying to resize. Actually, I
did solve the problem, but I'm sure I did it in a non-standard way that
you guys would be horrified at. :) Here's how I did it:

Sub tablefixing()
'
' tablefixing Macro
' Macro recorded 6/16/2006 by Brian Hartman
'
Selection.Homekey Unit:=wdStory `goes to the top of the document
Selection.Find.ClearFormatting ' All this code below finds the
right column
Selection.Find.Font.Bold = True
With Selection.Find
.Text = "Drug Development Phase"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.Tables(1).Select 'this selects the column
With Selection.Tables(1)
.TopPadding = InchesToPoints(0.02)
.BottomPadding = InchesToPoints(0.02)
.LeftPadding = InchesToPoints(0.02)
.RightPadding = InchesToPoints(0.02)
.Spacing = 0
.AllowPageBreaks = True
.AllowAutoFit = False ' This turns off the AutoFit so that the
whole table shrinks in width (A macro before this runs sets the width
to 9" for the table.)
End With
Selection.Homekey Unit:=wdStory
Selection.Find.ClearFormatting
Selection.Find.Font.Bold = True
With Selection.Find
.Text = "Drug Development Phase"
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute
Selection.SelectColumn
Selection.Columns.PreferredWidthType = wdPreferredWidthPoints
Selection.Columns.PreferredWidth = InchesToPoints(5.5) 'This sets
the desired column to 5.5 inches.
End Sub

Then I've got another macro that's whole job is to set the table's
width to 10" (on landscaped paper) so that it fits on a page. I guess
it's not pretty, but it turns out to work. everything is the right
size and no columns get cut off.
 
J

Jean-Guy Marcil

(e-mail address removed) was telling us:
(e-mail address removed) nous racontait que :
Salut, Jean-Guy.

Sorry about being confusing. I was using chart and table
interchangeably, which I shouldn't have. I'm actually dealing with a
table in a Word doc. The table's third column contains a nested table
in each row. It's this column that I'm trying to resize. Actually, I
did solve the problem, but I'm sure I did it in a non-standard way
that you guys would be horrified at. :) Here's how I did it:

Well, as long as it works!

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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