Table of contents

TabStop.Alignment 属性 (发布服务器)TabStop.Alignment Property (Publisher)

office 365 dev account|上次更新日期: 2018/3/13
2 参与人员

返回或设置一个PbTabAlignmentType常量,该常量表示指定的制表位的对齐方式。读/写。Returns or sets a PbTabAlignmentType constant that represents the alignment for the specified tab stop. Read/write.


表达式对齐方式expression. Alignment

_expression_A 表示TabStop对象的变量。_expression_A variable that represents a TabStop object.


对齐方式属性值可以是在 Microsoft 发布服务器类型库声明的PbTabAlignmentType常量之一。The Alignment property value can be one of the PbTabAlignmentType constants declared in the Microsoft Publisher type library.


本示例输入一个具有制表符的列表并设置两个自定义制表位的对齐方式。本示例假定指定形状是文本框架而不是其他类型的形状,并至少已设置了两个自定义制表位。This example enters a tabbed list and sets the alignment for two custom tab stops. This example assumes that the specified shape is a text frame and not another type of shape and that there are at least two custom tab stops already set.

Sub CustomDecimalTabStop() 

 With ActiveDocument.Pages(1).Shapes(1).TextFrame.TextRange 
 .InsertAfter Newtext:="Pencils" &; vbTab &; _ 
 "Each" &; vbTab &; "1.50" &; vbLf 
 .InsertAfter Newtext:="Pens" &; vbTab &; _ 
 "Each" &; vbTab &; "4.95" &; vbLf 
 .InsertAfter Newtext:="Folders" &; vbTab &; _ 
 "Box" &; vbTab &; "35.28" &; vbLf 
 .InsertAfter Newtext:="Envelopes" &; vbTab &; _ 
 "Case" &; vbTab &; "150.69" &; vbLf 
 With .Paragraphs(Start:=1).ParagraphFormat 
 .Tabs(1).Alignment = pbTabAlignmentCenter 
 .Tabs(2).Alignment = pbTabAlignmentDecimal 
 End With 
 End With 
End Sub
© 2018 Microsoft