Microsoft Word and Delphi

liunx

Guest
Hi I need to change the vertical alignment of the cells of a table in Word, using Delphi. I can left and right align, but I can't find how to align top or bottom. I need to bottom align my table.<br /><br />I have created a table in Word with Delphi like this:<br /><br />Word: _Application;<br />S: OleVariant;<br />R : OleVariant;<br />Direction, Separator, Format: OleVariant;<br /><br />//Some code to open file and start Word etc, etc.<br /><br />//Then I create table like this<br />S := Word.Selection;<br />R := Word.Selection.Range;<br />Direction := wdCollapseEnd;<br />R.Collapse(Direction);<br /><br />XmlParser.ParseFile; //This just adds strings to R<br /><br />Separator := ',';<br />Format := wdTableFormatGrid1;<br />R.ConvertToTable(Separator, EmptyParam, EmptyParam,<br /> EmptyParam, Format, EmptyParam,<br /> EmptyParam, EmptyParam, EmptyParam,<br /> EmptyParam, EmptyParam, EmptyParam,<br /> EmptyParam, EmptyParam);<br /><br />//Left align text in cells<br />R.ParagraphFormat.Alignment := wdAlignParagraphLeft; <br /><br />Word.Visible := True;<br />////////////////////////////////////////////////////////////////<br />How to do vertical alignment?<br />I have tried this line of code but it doesn't work, (borrowed from how it is done in Excel).<br />R.ParagraphFormat.VerticalAlignment := wdVAlignCenter;<br /><br />Anyone have ideas for me?<br /><br />
</div>
 
Top