Reply
 
Thread Tools Display Modes
  #1   Report Post  
Ulrich
 
Posts: n/a
Default HowTo: Align Tablecolumn

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.


  #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.




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
align text center and right on the same line Annette Frank Microsoft Word Help 9 May 5th 23 08:49 AM
howto search for a word in more than one *.doc (search in all doc's in a folder)? erik Microsoft Word Help 2 February 11th 05 03:02 PM
align right problems everything aligns right not selction Highlander Page Layout 2 January 10th 05 04:09 PM
how to align list numbers on decimal rexv New Users 1 January 8th 05 03:33 AM
How do I vertically align a table in Word? Cocosa Tables 1 January 4th 05 09:53 PM


All times are GMT +1. The time now is 11:12 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"