View Single Post
  #2   Report Post  
Pat Garard
 
Posts: n/a
Default

G'Day Ulrich,

Try this:

Sub ColumnAlign()
' Using your sample code.....
Set Tbl = WordDoc.Tables.Add(somRange, intRows, intCols)
' You have put some text into a cell
Tbl.Cell(iRow, iCol).Range.Text = someText
:
' We have NO IDEA where the insertion point is at this time....
'....so select the text we inserted....
Tbl.Cell(iRow, iCol).Range.Select
:
' Now that the Insertion Point is in that same Cell - Select the
Column.....
Selection.SelectColumn
' ....and Format It
Selection.ParagraphFormat.Alignment = wdAlignParagraphRight
End Sub
--
Regards,
Pat Garard
Melbourne, Australia
_______________________

"Ulrich" wrote in message
...
Hi,

how can i (right-)align a table's column in vb?

I use the following code:

Set Tbl = WordDoc.Tables.Add(somRange, intRows, intCols)

Tbl.Cell(iRow, iCol).Range.Text = someText

Now i want to right-align or center one of the columns icol. Using the
table
or selection range-method .Rows.Alignment=wdAlignRowRight does not work!
What do i do wrong?

Please help me someone. Thanks.