Table of contents
Collapse the table of content
Expand the table of content

Shapes.AddLabel Method (Publisher)

office 365 dev account|Last Updated: 8/24/2017
3 Contributors

Adds a new Shape object representing a text label to the specified Shapes collection.


expression. AddLabel( Orientation, Left, Top, Width, Height)

_expression_A variable that represents a Shapes object.


NameRequired/OptionalData TypeDescription
OrientationRequiredPbTextOrientationThe orientation of the label.
LeftRequiredVariantThe position of the left edge of the shape representing the text label.
TopRequiredVariantThe position of the top edge of the shape representing the text label.
WidthRequiredVariantThe width of the shape representing the text label.
HeightRequiredVariantThe height of the shape representing the text label.

Return Value



For the Left, Top, Width, and Height arguments, numeric values are evaluated in points; strings can be in any units supported by Microsoft Publisher (for example, "2.5 in").

The Orientation parameter can be one of these PbTextOrientation constants.

| pbTextOrientationHorizontal|A horizontal text label for left-to-right languages.| | pbTextOrientationRightToLeft| A horizontal text label for right-to-left languages.| | pbTextOrientationVerticalEastAsia|A vertical text label for East Asian languages.|


The following example adds a new horizontal text label to the first page of the active publication.

Dim shpLabel As Shape 

Set shpLabel = ActiveDocument.Pages(1).Shapes.AddLabel _ 
 (Orientation:=pbTextOrientationHorizontal, _ 
 Left:=144, Top:=144, _ 
 Width:=72, Height:=18)
© 2018 Microsoft