title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
Table.TableDirection property (Publisher) |
vbapb10.chm4784135 |
|
|
ffd664a8-781f-8fdc-055c-1ea7309b3b38 |
06/14/2019 |
medium |
Returns or sets a PbTableDirectionType constant that represents whether text in a table is read from left to right or from right to left. Read/write.
expression.TableDirection
expression A variable that represents a Table object.
PbTableDirectionType
The TableDirection property value can be one of the PbTableDirectionType constants declared in the Microsoft Publisher type library: pbTableDirectionLeftToRight or pbTableDirectionRightToLeft.
This example enters a bold number into each cell in the specified table, and then sets the direction of the table so that the cells number from right to left. For this example to work, the specified shape must be a table.
Sub CountCellsByColumn()
Dim tblTable As Table
Dim rowTable As row
Dim celTable As Cell
Dim intCount As Integer
Set tblTable = ActiveDocument.Pages(1).Shapes(1).Table
'Loops through each row in the table
For Each rowTable In tblTable.Rows
'Loops through each cell in the row
For Each celTable In rowTable.Cells
With celTable.TextRange
intCount = intCount + 1
.Text = intCount
.ParagraphFormat.Alignment = _
pbParagraphAlignmentCenter
.Font.Bold = msoTrue
End With
Next celTable
Next rowTable
tblTable.TableDirection = pbTableDirectionRightToLeft
End Sub
[!includeSupport and feedback]