TableDirection Property

Microsoft Publisher Visual Basic

constant that represents whether text in a table is read from left to right or from right to left. Read/write.

PbTableDirectionType can be one of these PbTableDirectionType constants.
pbTableDirectionLeftToRight
pbTableDirectionRightToLeft

expression.TableDirection

expression    Required. An expression that returns one of the objects in the Applies To list.

Example

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