Table.TableDirection 属性 (Publisher)

返回或设置一个 PbTableDirectionType 常量,该常量表示是从左到右还是从右到左读取表中的文本。 读/写。

语法

表达式TableDirection

表达 一个代表 Table 对象的变量。

返回值

PbTableDirectionType

备注

TableDirection 属性值可以是 Microsoft Publisher 类型库中声明的 PbTableDirectionType 常量之一:pbTableDirectionLeftToRightpbTableDirectionRightToLeft

示例

本示例在指定表格的每个单元格中输入一个粗体数字,然后设置表格的方向,使单元格数字的阅读方向为从右向左。 为了使本例生效,指定的形状必须是表格。

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

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。