Group: microsoft.public.word.vba.general
From: =?Utf-8?B?SkJ1c2J5?=
Date: Friday, March 07, 2008 11:01 PM
Subject: Re: WORD 2007 VBA VERTICALALIGN PROPERTY

Hello, and thanks, Jean-Guy.

My expectations were:
(1) that a table cell could be vertically justified independently of another
cell - or nested table - in the same row, and
(2) that my page layout would have vertical alignment in a table cell behave
in the same way as vertical alignment in Page Setup - with the vertical
alignment of text on the last line of every page occurring exactly at the
bottom margin.

The cell contained text only. The adjoining cell in the same row contained a
nested table with an in-line graphic.

The row was formatted with
"Specify Height" checked,
"Row Height is: At Least", and with
"Allow Row to Break across Pages" checked.

The Column Dialogue Box showed "Preferred Width" checked, and I changed the
"Measure In:" setting to Percent.

The code you suggested works fine for "Top", "Center", and "Bottom"
settings for vertical alignment, but substituting "Justify" for any of these
in the code results only in the active table cell being "high-lighted."



--
JBusby


"Jean-Guy Marcil" wrote:

> "JBusby" wrote:
>
> > Thanks for responding, Jonathan.
> > Your response provides me with the perfect comment to describe the coding
> > itself. But my attempts at "the coding itself" - without much knowledge or
> > experience in VBA - haven't been very successful.
> > By recording a macro, I was able to copy the code that seemed relevant to
> > the task, but to no avail:
>
> What does "but to no avail" mean exaclty? If you want a solution to a
> specific problem, specfic details would be useful. :-)
>
> I assume you ran the code you posted on a cell.
> What did the cell contain?
> How is the row formatted?
> What were your expectations?
> What did you observe?
>
> Meanwhile, I do not have access to a Word 2007 machine, but the following
> code ran just fine:
>
> With Selection.Cells(1)
> .Range.ParagraphFormat.Alignment = wdAlignParagraphLeft
> .VerticalAlignment = wdCellAlignVerticalCenter
> End With
>
> I guess you only need to change
> wdCellAlignVerticalCenter
> by
> wdCellAlignVerticalJustify
> (Verticall justification of cells is not available in 2003, so I can't test
> that part... but be aware that generally, vertical justification does not
> always produce the desired results..., I have used it in sections with
> varying degrees of satisfaction... Also, keep in mind that empty paragraphs
> are also "justified".)
>

Safety Articles | Usenet Groups | Usenet News | Bluegrass